ACTUAL Exam Questions and CORRECT
Answers
Having multiple class methods of the same name where each method has a different number of
or type of parameters is known as - CORRECT ANSWER - Method Overloading
The relationship between a class and an object is best described as - CORRECT
ANSWER - Objects are instances of classes
To define a class that will represent a car, which of the following definitions is most appropriate?
- CORRECT ANSWER - public class Car
Which of the following reserved words in Java is used to create an instance of a class? -
CORRECT ANSWER - new
Consider a sequence of method invocations as follows: main calls m1, m1 calls m2, m2 calls m3
and then m2 calls m4, m3 calls m5. If m4 has just terminated, what method will resume
execution? - CORRECT ANSWER - m2
A class' constructor usually defines - CORRECT ANSWER - How an object is initialized
Java methods can return only primitive types (int, double, float, char, boolean, etc). - CORRECT
ANSWER - False
All Java classes must contain a main method which is the first method executed when the Java
class is called upon. - CORRECT ANSWER - False
use the following class definition: