Java Classes Question:

The type of data returned by a method need not be compatible with the return type specified by the method
A) True
B) False

Java Classes Interview Question
Java Classes Interview Question

Answer:

Explanation: The type of data returned by a method must be compatible with the return type specified by the method. For example, if the return type of some method is boolean, you could not return an integer

A) its False

The return type must be compatible


Previous QuestionNext Question
A stack stores data using first-in, last-out ordering.

A) True
B) False
This can be used inside any method to refer to the current object

A) True
B) False