Chapter Questions

Class, Object and Methods in java Questions

Explore chapter-wise explanatory questions and quickly move between related subchapters from a cleaner, more advanced layout.

Questions List

Browse all explanatory questions of this chapter.

50 Total Questions
1

Why is the compute() method recursive?

return n * compute(n - 1);
        

Question ID: 10680 Read Details
2

Write a Java program to demonstrate recursion.

Question ID: 10679 Read Details
3

What is the mathematical idea behind recursion?

Question ID: 10678 Read Details
4

What is direct recursion?

Question ID: 10677 Read Details
5

How is recursion different from a normal function call?

Question ID: 10676 Read Details
6

What is a recursive function?

Question ID: 10675 Read Details
7

What is recursion?

Question ID: 10674 Read Details
8

What are the four key features of an object?

Question ID: 10570 Read Details
9

Why is Java called an object-oriented programming language?

Question ID: 10569 Read Details
10

Define class and object with an example.

Question ID: 6462 Read Details
11

How will you define a software object?

Question ID: 6461 Read Details
12

Can constructor perform other tasks instead of initialization?

Question ID: 533 Read Details
13

Difference between constructor and method in Java

Question ID: 532 Read Details
14

What is Constructor Overloading in Java?

Question ID: 531 Read Details
15

Why use the parameterized constructor in Java?

Question ID: 530 Read Details
16

What is the purpose of a default constructor?

Question ID: 529 Read Details
17

Types of Java constructors in Java

Question ID: 528 Read Details
18

When is a constructor called

Question ID: 527 Read Details
19

Rules for creating Java constructor

Question ID: 526 Read Details
20

What is the default constructor?

Question ID: 525 Read Details
21

What will be the default values of all the elements of an array defined as an instance variable?

Question ID: 251 Read Details
22

What is constructor chaining and how is it achieved in Java?

Question ID: 248 Read Details
23

What restrictions are placed on method overriding?

Question ID: 247 Read Details
24

What is the difference between inner class and nested class?

Question ID: 246 Read Details
25

If a method is declared as protected, where may the method be accessed?

Question ID: 245 Read Details
26

What are order of precedence and associativity and how are they used?

Question ID: 244 Read Details
27

What is an object's lock and which object's have locks?

Question ID: 242 Read Details
28

Can a class declared as private be accessed outside it's package?

Question ID: 238 Read Details
29

Can a vector contain heterogenous objects?

Question ID: 235 Read Details
30

What is the SimpleTimeZone class?

Question ID: 233 Read Details
31

What is the GregorianCalendar class?

Question ID: 232 Read Details
32

What is Nested top-level class?

Question ID: 226 Read Details
33

What is the immediate super class of Menu?

Question ID: 202 Read Details
34

Where and how can you use a private constructor?

Question ID: 196 Read Details
35

Can constructor be inherited?

Question ID: 190 Read Details
36

What is runtime polymorphism or dynamic method dispatch?

Question ID: 188 Read Details
37

Can a top level class be private or protected?

Question ID: 181 Read Details
38

What is the default value of an object reference declared as an instance variable?

Question ID: 180 Read Details
39

Under what conditions is an object's finalize() method invoked by the garbage collector?

Question ID: 172 Read Details
40

Which class is the immediate superclass of the Container class?

Question ID: 170 Read Details
41

What is the purpose of the System class?

Question ID: 167 Read Details
42

Can you call one constructor from another if a class has multiple constructors?

Question ID: 156 Read Details
43

What's the difference between constructors and other methods?

Question ID: 153 Read Details
44

What is final class?

Question ID: 130 Read Details
45

Difference between Overloading and Overriding?

Question ID: 129 Read Details
46

What is Method/function overriding?

Question ID: 128 Read Details
47

What is Method/function overloading?

Question ID: 127 Read Details
48

Define composition?

Question ID: 126 Read Details
49

What is Encapsulation?

Question ID: 100 Read Details
50

What is finalize() method?

Question ID: 85 Read Details