- Value-A
- Compilation fails-Exception NullPointerException is not compatible with throws clause in A.printName()
- Name-B
- Compilation succeed but no output
- None of these
Answer: Option 2 First execute static block, then statement block and then constructor.
1 Answers 1 viewsAnswer: Option 2 You can not override private method , private method is not availabe in subclass . In this case printName() method a class A is not overriding by...
1 Answers 87 viewsAnswer: Option 1 The options B, C and D are incorrect options as in Java we can declare an abstract class comprising of abstract and non-abstract methods that will not...
1 Answers 1 viewsAnswer: Option 1 Overriding in Java simply means that the particular method would be called based on the run time type of the object and not on the compile time...
1 Answers 1 viewsAnswer: Option 2 Let'
1 Answers 4 viewsAnswer: Option 3 We cannot reduce the visibility of the inherited method from super class. If the overridden or hidden method is public, then the overriding or hiding method must...
1 Answers 6 views