Questions List
Browse all explanatory questions of this chapter.
1
Why is the compute() method recursive?
return n * compute(n - 1);
return n * compute(n - 1);
2
Write a Java program to demonstrate recursion.
3
What is the mathematical idea behind recursion?
4
What is direct recursion?
5
How is recursion different from a normal function call?
6
What is a recursive function?
7
What is recursion?
8
What are the four key features of an object?
9
Why is Java called an object-oriented programming language?
10
Define class and object with an example.
11
How will you define a software object?
12
Can constructor perform other tasks instead of initialization?
13
Difference between constructor and method in Java
14
What is Constructor Overloading in Java?
15
Why use the parameterized constructor in Java?
16
What is the purpose of a default constructor?
17
Types of Java constructors in Java
18
When is a constructor called
19
Rules for creating Java constructor
20
What is the default constructor?
21
What will be the default values of all the elements of an array defined as an instance variable?
22
What is constructor chaining and how is it achieved in Java?
23
What restrictions are placed on method overriding?
24
What is the difference between inner class and nested class?
25
If a method is declared as protected, where may the method be accessed?
26
What are order of precedence and associativity and how are they used?
27
What is an object's lock and which object's have locks?
28
Can a class declared as private be accessed outside it's package?
29
Can a vector contain heterogenous objects?
30
What is the SimpleTimeZone class?
31
What is the GregorianCalendar class?
32
What is Nested top-level class?
33
What is the immediate super class of Menu?
34
Where and how can you use a private constructor?
35
Can constructor be inherited?
36
What is runtime polymorphism or dynamic method dispatch?
37
Can a top level class be private or protected?
38
What is the default value of an object reference declared as an instance variable?
39
Under what conditions is an object's finalize() method invoked by the garbage collector?
40
Which class is the immediate superclass of the Container class?
41
What is the purpose of the System class?
42
Can you call one constructor from another if a class has multiple constructors?
43
What's the difference between constructors and other methods?
44
What is final class?
45
Difference between Overloading and Overriding?
46
What is Method/function overriding?
47
What is Method/function overloading?
48
Define composition?
49
What is Encapsulation?
50