- There is a NullPointerException. Everything went fine.
- There is a NullPointerException.
- There is a NullPointerException. There is an Exception.
- This code will not compile, because in Java there are no pointers.
Answer: Option 2 Let'
1 Answers 1 viewsAnswer: Option 3 1. new Derived(); statement executes and invoke the non-parametrized constructor of derived class i.e. public Derived(); 2. As Derived class is a subclass of class Base so super(); executes...
1 Answers 25 viewsAnswer: Option 3 The overriding method can throw any unchecked (runtime) exception, regardless of exception thrown by overridden method. NullPointerException is RuntimeException so compiler will not complain.
1 Answers 1 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 Finally block will execute irrespective of return statement in try block.
1 Answers 2 viewsAnswer: Option 3 Let'
1 Answers 2 views