Correct Answer : Get Lastest Questions and Answer : Explanation: There is no too much mind should be used. It is just a syntax error. When you are catching multiple exception, in single catch block you should have used | (single pipe) an dnot ||. Otherwise entire code is fine.
Question : You have been given following exception hierarchy.
Correct Answer : Get Lastest Questions and Answer : Explanation: As we know in multi catch statement , we should not have both Parent and Child exception. We can have peer exception.
Question : You have been given following exception hierarchy.
Correct Answer : Get Lastest Questions and Answer : Explanation: As we are aware java has a feature of dynamic binding. That means at run time actual instance will be used. Here the actual instance of exception is HChild2Exception. Event we are casting it with Exception, it will use only actual exception. Hence , it will print HChild2Exception
2. It will compile perfectly, but give runtime Exception.
3. It will not even compile, because method Welcome(int ) is not available.
4. It will compile and run perfectly with output as Counter Value =0.
5. : As you know, whenever you do constructor chaining i.e. Same class constructor should be called by another constructor. You should have use this(10) instead of Welcome(10). As it is trying to look for Welcome(10) method.