1. Method overloads: Overload (), same as method names, but with different parameters. Construction methods can also be overloaded.
In-memory layouts
2.this Keyword: This is a variable, is a reference to the current object, this is pointing to himself.
You can handle the case where the name of a member variable and parameter in a method.
3.static keyword: A common variable for a class, initialized for the first time, with only one copy. Allocated in the data area.
No matter the new object instance, it has only one copy. Any object instance can access a static object and access the same piece of memory. (string constants are also in the data area)
The static method of the static declaration does not pass a reference to the object to it when the method is called, so the non-static member is inaccessible in the static method.
4. Package
Resolves a naming conflict problem with classes, providing a tired multi-class namespace.
To define a class:
Package COM.BJSXT;
public class cat{}
Reference class:
Import Com.bjsxt.Cat;
The parent directory of the topmost package of the class file must be located under Classpath. Executes a class to write all-inclusive names.
Package your own class into a jar package: Navigate to the top-level file of the package: JAR-CVF Xx.jar * *
* * Pack all the files into a jar package
Java Learning---3. Object oriented