This is my own memo for learning Java.
・ A realization of the class (blueprint) -Saved in the heap area * 1 ・ Generate using the keyword new * 2
-Contains a reference (such as an address: link information) to the instance, not the instance itself -Also called an object type variable -There is null as a special value that indicates that there is no reference.
・ The variable itself is data ・ Int type, double type, char type, etc. ・ Basic type provided as a specification
-Automatically executed at the same time as instantiation -The method name must be the same as the class name -Cannot describe return type -Can be called only when an instance is created -Automatically defined by the compiler without being defined by the programmer (default constructor) -When executing a program, other methods can be called after the constructor processing is completed.
-There is an automatic memory management function that automatically discards instances that are no longer needed from memory, and this is called a "garbage collector". -The garbage collector automatically determines when garbage collection is executed. -The act of the garbage collector destroying an instance in memory
-Method names and arguments are collectively called signatures. -Different signatures are identified by the compiler and JVM as different methods ・ Constructor can also be overloaded
-There is a mechanism to store a class file in a part of the heap area and create an instance from it. -The area where this class file is stored is called the "permanent area". -Methods and fields with static modifiers are created in the static area. -Static methods and fields can be used even if no instance has been created. -A compile error occurs when trying to access an instance member from a static member
Recommended Posts