I am a beginner, but I summarized it for personal study
** After loading **, the static contents of the class file are placed in the memory area called ** static area **, and the others are placed in the ** heap area **. ** Class variables ** and ** class methods ** placed in the static area are positioned as one in the class. No matter how many instances are created from that class, member variables and methods are not assigned to each instance, and only one data is created. Therefore, ** all instances share the same value **, so you can use it without creating an instance **
** * Load ** ・ ・ ・ Reading a class file
** * Class variables, class methods ** ・ ・ ・ Those with static qualifiers ** Class variables **, ** Class methods **, those without static qualifiers ** Instance variables Called **, ** instance method **
Static members can be used with or without an instance, but non-static members cannot be used without an instance Due to this rule, static methods can only be accessed ** statically qualified **
・ There are two ways to access ① ** Class name. Field name ** (2) ** Variable name.Field name ** after instance creation
・ There are two ways to initialize ① Set the value at the time of declaration ② Set the value with ** static initializer **
** * static initializer ** -Blocks that are executed only once at load time only with the static modifier -Describe the process you want to call and execute before instantiating a certain class or before the main method
-Static method belongs to the class and performs the specified process regardless of the state of the instance, so it is often used to implement the process that is used for general purposes.
·how to access ① Call ** Class name. Method name (argument, ...) ** (2) Refer to the method of the functional interface ** Class name :: Method name (argument, ...) **