Professional Documents
Culture Documents
Variable
Variable is name of reserved area allocated in memory
Local Variable:- A variable which is declared inside the method is called local variable.
Instance Variable:- A variable which is declared inside the class but outside the method, is called instance
variable . It is not declared as static.
Static variable:- A variable that is declared as static is called static variable. It cannot be local.
Rules for creating java constructor there are basically two rules defined for the constructor.
1. Constructor name must be same as its class name
2. Constructor must have no explicit return type
Types of java constructors there are two types of constructors:
1. Default constructor
2. Parameterized constructor
The main new concepts in OOP are:
1. encapsulation
2. polymorphism
3. inheritance
method overloading is an example of polymorphism. The general concept of polymorphism is “one interface,
multiple methods”.