Breaking Thoughts in Java Learning

Welcome to pay attention to my public account [Software Big Bang]
Java learning
basic knowledge that is easy to ignore in
Java Java object-oriented basics
Core classes in
Java Java abstract classes and interfaces
Exceptions in
Java Generics and collections in Java
JRE (Java Runtime Environment, Java Runtime Environment) is a collection of environments on which Java programs run, including class loader, bytecode verifier ava virtual machine lava API. JRE has been included in the JDK, but if only In order to run Java programs instead of engaging in Java development, you can directly download and install JRE

JVM (Java Virtual Machine, Java Virtual Machine) is a fictitious computer, realized by simulating various computer functions on an actual computer. The Java virtual machine has its own complete hardware architecture, such as processors, stacks, registers, etc., as well as corresponding instruction systems. The Java virtual machine shields the ava8 basic application and development information related to the specific operating system platform. You only need to compile the Java language program into the target code (.class bytecode) that runs on the Java virtual machine, and it can be used on multiple platforms Run without modification. When the Java virtual machine executes the bytecode, it actually interprets the bytecode as the execution of machine instructions on the specific platform.

Virtual machine icon : When the
Insert picture description here
JVM is executed, a runtime environment will be created inside it. Each time a Java statement is read and executed, there are three processes: loading code, verifying code, and executing code, as shown in the
Insert picture description here
bytecode What the validator does

  • Variables must be initialized before use
  • Match before method call and object reference type
  • The rules for accessing private data and methods have not been violated
  • Access to local variables falls on the runtime stack
  • The stack does not overflow during runtime.
    You can refer to the article by this big guy: Portal

Garbage Collection Mechanism (GC)
The memory allocation and recycling of Java programs are automatically performed by JRE in the background.
Not only release useless objects, but also clean up memory and defragment.
You can set the reference variable of the object to null, which implies that the garbage collection mechanism can reclaim the object.
But there is no way to know the precise time at which garbage collection runs.

Documentation notes

/** 文档注释内容 */
//用法: javadoc [options] [packagenames] [sourcefiles] [@files]

For example:

/**
*@author:kingdeguo
*@version
*/
package cn.zixue.unit01;

public class Student {
    
    
    public static void main(String[] args) {
    
    
        for (int i = 0; i < 10; i++) {
    
    
            System.out.print(i+1 + " ");
        }
        System.out.println();
        for (int j = 10; j > 0; j--) {
    
    
            System.out.print(j + " ");
        }
    }
}

D:>javadoc Student.java

正在加载源文件Student.java...
正在构造 Javadoc 信息...
标准 Doclet 版本 1.8.0_181
正在构建所有程序包和类的树...
正在生成.\cn\zixue\unit01\Student.html...
正在生成.\cn\zixue\unit01\package-frame.html...
正在生成.\cn\zixue\unit01\package-summary.html...
正在生成.\cn\zixue\unit01\package-tree.html...
正在生成.\constant-values.html...
正在构建所有程序包和类的索引...
正在生成.\overview-tree.html...
正在生成.\index-all.html...
正在生成.\deprecated-list.html...
正在构建所有类的索引...
正在生成.\allclasses-frame.html...
正在生成.\allclasses-noframe.html...
正在生成.\index.html...
正在生成.\help-doc.html...

The following files can be generated.
Insert picture description here
Open index.html and
Insert picture description here
click student, you can see the related information of this category
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44895666/article/details/107167508