Loading

Q1.

Which of the following correctly defines a method in Java?

A. method add() {}

B. void add(int a, int b) {}

C. add void(int a, int b) {}

D. public add() void {}

Q2.

What will be the return type of a method that does not return any value?

A. empty
B. null
C. void
D. None

Q3.

What is method overloading in Java?

A. Defining multiple methods with the same name but different parameters

B. Using multiple classes in one program

C. Creating nested methods

D. Using the same method name in different packages

Q4.

Which of the following methods is the entry point of every Java program?

A. run()

B. start()

C. main()

D. execute()

Q5.

Which keyword is used to call a method of the same class?

A. this
B. super
C. static
D. class