class A{
final void show(){
System.out.println("This method cant override");
}
}
class B extends A{
/***********
* This is an Error
void show(){
System.out.println("Error");
}
*********/
}
public class Main{
public static void main(String args[]){
A supob = new A();
B subob = new B();
supob.show();
}
}
Using Final
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment