1
CSE 205 Final Questions with Correct Answers
| Updated (100% 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
a) method overloading
b) Encapsulation
c) importing
d) information hiding
e) encapsulation Answer: a) method overloading
The relationship between a class and an object is best described as
a) objects are instances of classes
b) classes are instances of objects
c) classes are programs while objects are variables
d) objects and classes are the same thing
e) objects are the instance data of classes Answer: a) objects are
instances of classes
© 2025 All rights reserved
,2
To define a class that will represent a car, which of the following
definitions is most appropriate?
a) public class CAR
b) public class car
c) private class car
d) private class Car
e) public class Car Answer: e) public class Car
Which of the following reserved words in Java is used to create an
instance of a class?
a) new
b) public
c) public or private, either could be used
d) class
e) import Answer: a) new
What does acronym API stands for?
a) Application Parameter Internet
b) Application Programming Interface
© 2025 All rights reserved
,3
c) Apply Programming Interactive
d) Abstraction Programming Interface Answer: b) Application
Programming Interface
A class' constructor usually defines
a) how an object is initialized
b) how an object is interfaced
c) if the instance data are accessible outside of the object directly
d) the number of methods in the class
e) the number of instance data in the class Answer: a) how an
object is initialized
Java methods can return only primitive types (int, double, float, char,
boolean, etc).
True
False Answer: False
All Java classes must contain a main method which is the first
method executed when the Java class is called upon.
True
© 2025 All rights reserved
, 4
False Answer: 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)
{ name = newName;
major = newMajor;
gpa = newGPA;
hours = newHours;
}
public String toString( )
© 2025 All rights reserved
CSE 205 Final Questions with Correct Answers
| Updated (100% 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
a) method overloading
b) Encapsulation
c) importing
d) information hiding
e) encapsulation Answer: a) method overloading
The relationship between a class and an object is best described as
a) objects are instances of classes
b) classes are instances of objects
c) classes are programs while objects are variables
d) objects and classes are the same thing
e) objects are the instance data of classes Answer: a) objects are
instances of classes
© 2025 All rights reserved
,2
To define a class that will represent a car, which of the following
definitions is most appropriate?
a) public class CAR
b) public class car
c) private class car
d) private class Car
e) public class Car Answer: e) public class Car
Which of the following reserved words in Java is used to create an
instance of a class?
a) new
b) public
c) public or private, either could be used
d) class
e) import Answer: a) new
What does acronym API stands for?
a) Application Parameter Internet
b) Application Programming Interface
© 2025 All rights reserved
,3
c) Apply Programming Interactive
d) Abstraction Programming Interface Answer: b) Application
Programming Interface
A class' constructor usually defines
a) how an object is initialized
b) how an object is interfaced
c) if the instance data are accessible outside of the object directly
d) the number of methods in the class
e) the number of instance data in the class Answer: a) how an
object is initialized
Java methods can return only primitive types (int, double, float, char,
boolean, etc).
True
False Answer: False
All Java classes must contain a main method which is the first
method executed when the Java class is called upon.
True
© 2025 All rights reserved
, 4
False Answer: 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)
{ name = newName;
major = newMajor;
gpa = newGPA;
hours = newHours;
}
public String toString( )
© 2025 All rights reserved