class Base{
protected int i = 99;
}
public class Ab{
private int i=1;
public static void main(String argv[]){
Ab a = new Ab();
a.hallow();
}
abstract void hallow(){
System.out.println("Claines "+i);
}
}
1) Compile time error
2) Compilation and output of Claines 99
3) Compilation and output of Claines 1
4) Compilation and not output at runtime
Answer 1:
1) Compile time error
When compiled with JDK 1.1 the following error is produced.
Abstract and native methods can't have a body: void hallow() abstract void hallow()
No comments:
Post a Comment