Welcome Guest | Sign in | Register
Variables and Loops - Discussion Page For Q.2996 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Variables and Loops > Questions and Answers

Q: class Mango{
final int a=5;
}

class Fruit extends Mango {
final int a=10;
}

class DynamicDispatch extends Fruit{
final int a=20;
public static void main(String[] args){
Mango m=new DynamicDispatch();
Fruit f=new DynamicDispatch();
System.out.print(m.a|f.a);
}
}

What will be output of above program?
A. 15 B. 20
C. 30 D. Compiler error

Answer and Explanation

Answer:15

Explanation:
There is no explanation...

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.