Class 2 - Methodes in Java
Class 2 - Methodes in Java
Method declaration
}
Types of methods
1) System Defined Method / Pre defined Method
Already defined in java library
Regular Method
Two Types
1) Static Method
2) Non-static Method / instance method
1) Static Method 2) Non-static Method / instance method
Static method called directly in any method Non-static method can not called directly with name
Static method does not require Object to call To call Non-Static method need an Object.
Memory allocation for static method at the time Memory allocation for non-static method at the time
of compilation. of run
Key Point
If programs stuck in infinite loop, at the end it will throw stackOverFlowError.
Allocated call Stack memory exceed.