Inheritance of a final class and overriding of a final method is restricted and the variable value becomes fixed.
final int a = 100;
a = 0; // error
It is the block where all the codes written inside it get executed irrespective of handling of exceptions.
try {
int variable = 5;
}
catch (Exception exception) {
System.out.println("Exception occurred");
}
finally {
System.out.println("Execution of finally block");
}
System.exit()
in the above statement.Prior to the garbage collection of an object.
public static void main(String[] args) {
String example =new String("InterviewBit");
example =null;
System.gc(); // Garbage collector called
}
public void finalize() {
// Finalize called
}