Chapter I. Java Overview
1.java does not allow executable statements, methods and other components to exist independently, all programs must be placed in the class definition.
The parameter of the 2.main method must be a string array (string[] args is a string array form), so the method of main is almost fixed.
3. The source code has a public class, and the primary file name must be the same as the public name.
4.java heap Memory is a runtime data area that holds the instance (object), and the Java Virtual machine's heap memory holds all the objects that are created by the running application. When an object is no longer referenced, the memory reclaims the space he occupies, and also the memory record fragment. One potential drawback of garbage collection is that its overhead affects performance. The Java virtual machine must keep track of the objects that are useful in the program in order to determine which objects are useless objects and eventually dispose of those useless objects. This process requires the time of the processor. Second, garbage collection algorithm is not complete. No 100% guarantees that garbage is fully recycled (finds useless objects, reclaims space occupied by useless objects).
5. The accuracy of garbage collection mainly includes two aspects: 1) garbage collection mechanism can accurately mark the Living object 2) The garbage collector can accurately locate the reference relationship between objects
The smallest unit of 6.java is a class, and the entire Java consists of a single class.
7.
An essay on Crazy Java