Home Java
Post
Cancel

Java

Constructor

It is used in the creation of an object that is an instance of a class

when constructor works

It performs operations operations the class is created

Is the constructor inherited or not

X

Overload

can differentiat the number of parameters, the types of the parameters and the order of the parameter types in Compiler distinguishes between methods with them

How to work JAVA

java file(source file) -> compile -> class file

When several classes in a source file

After compiling, the compiler places both class files for those classes in the same directory

only one public class put in a source-code file

Get and Set Method

MethodOther NameExplanation
Setmutator methodchange an object’s state
Getaccessor method query methodcontrol of access from client
Validation check

Declared private do not allow automatically guaranteed data integrity

This post is licensed under CC BY 4.0 by the author.