Write a program using local variable
Public void someMethod( ) {
int x; //local variable
System.out.println(x); // compile time error
}
- Constructor
- Doesn't have a return type
- Same name as class name
- No initialization list
- JVM provides a zero argument (default) constructor only if a class doesn't define it's own constructor
- Destructors
- Aren't required in java class since memory management is the responsibility of JVM.