Professional Documents
Culture Documents
may contain constructors but the programmer is not allowed to create an object
of abstract class, but internally JVM is allowed to create an instance.
10. The 1st child class extending an abstract class is responsible to provide
implementation for all the abstract methods present in the parent class,
otherwise the child class should also be declared as abstract .
Final Classes :
1. final is a keyword which can be applied for the classes methods and variables.
2. final methods :
If a method declared as final, we r not allowed to over side this method in the
child class violation leads to CTE.
Eg : Public class A
{
final public void M1( )
{
SOP ( A s M1 Method );
}
}
Class B extends A
{
Public void M1( )
{
SOP ( B s M1 Method );
}
}
CTE : M1( ) in B can t override M1( ) in A.;
Overridden Method is final