Professional Documents
Culture Documents
Ans:
2. An inner class has access to the other members 7. Given the following hierarchy
of its enclosing class. True or False? class Alpha {……
class Beta extends Alpha {….
Ans: class Gamma extends Beta {….
In what order are the constructors for these classes
executed when Gamma object is instantiated?
Ans:
3. Show how to declare a method called sum() that 8. Given two interfaces called Alpha and Beta, show how
takes a variable number of int arguments(use a a class called Myclass specifies that it implements each.
return type of int) Ans:
Ans:
4. Predict the output of following Java Program. 9. Predict the output of following Java program
Ans:
5. Which of these is a super class of all errors and 10. What is an exception?
exceptions in the Java language? Ans:
a) RunTimeExceptions
b) Throwable
c) Catchable
d) None of the above
Ans: