Java Classes Question:

If the method does not return a value, its return type must be void
A) True
B) False

Java Classes Interview Question
Java Classes Interview Question

Answer:

It's true. If a method is not returning any value then we must have to specify it's return type as void.void indicates that method is not returning any value.


Previous QuestionNext Question
What is the difference between instantiation & initialization?In this example class-var = new classname( ); The class name followed by parentheses specifies the _________ for the class

A) Variables
B) Constructor
C) Objects
D) Memory