Topic Wise Java Questions
Topic Wise Java Questions
Topic Wise Java Questions
Blocks
Constructors
Method overloading
Inheritance
10. What happens if a class is declared as final? Example for final class
Packages
11. Does abstract class allows static members? If Yes, how to access them?
Write an example.
Interface
Typecasting
Method Overriding
13. While overriding, why co-variant type changes allowed & why not contra variant?
7. WAP to compare whether two cars are same or not w.r.t name, price & color.
8. WAP to compare whether two watches are same or not. Program should also
10. Explain when the objects will be created in SCP & heap memory?
14. Why do you think there are two ways of creating object of String class
11. Can one try block have multiple catch blocks? If yes which catch block will
12. Can we write generalized catch block & specialized catch block together?
13. How many exceptions occur in single try block? How to handle more than one
exception?
16. Explain the difference between JVM creating an exception object & user creating
an exception object?
17. Explain exception propagation? & when exception object will propagate?