Verified Study Tests
Having multiple class methods of the same name where each method has a different number of or type of
parameters is known as ANS Method Overloading
The relationship between a class and an object is best described as ANS Objects are instances of classes
To define a class that will represent a car, which of the following definitions is most appropriate? ANS
public class Car
Which of the following reserved words in Java is used to create an instance of a class? ANS 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? ANS m2
A class' constructor usually defines ANS How an object is initialized
Java methods can return only primitive types (int, double, float, char, boolean, etc). ANS False
All Java classes must contain a main method which is the first method executed when the Java class is called
upon. ANS False
use the following class definition:
import java.text.DecimalFormat;
public class Student{ private String name;
private String major;
private double gpa;
private int hours;
public Student(String newName, String newMajor, double newGPA, int newHours)