Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 9 pages
Exam (elaborations)

CSE 205 Final UPDATED ACTUAL Exam Questions and Correct|

Document preview thumbnail
Preview 2 out of 9 pages

CSE 205 Final UPDATED ACTUAL Exam Questions and Correct|

Content preview

CSE 205 Final UPDATED ACTUAL Exam
Questions and Correct|



CSE 205 Final Exam
Actual Exam Practice Questions (90+ Verified Questions)

Question 1: Which of the following could be used to instantiate a new Student object
named s1?
a) new Student(s1);
b) new Student s1 = ("Jane Doe", "Computer Science", 3.333, 33);
c) Student s1 = new Student("Jane Doe", "Computer Science", 3.333, 33);
d) Student s1 = new Student( );

Correct Answer: c) Student s1 = new Student("Jane Doe", "Computer Science", 3.333, 33);
Rationale: In Java, object instantiation requires the new keyword followed by a call to the
class constructor. Option c correctly declares a variable of type Student and assigns it a new
object using a valid constructor. Option a incorrectly passes an object as a parameter to the
constructor; options b and d have syntax errors regarding type declaration and instantiation.

Question 2: Consider a method defined with the header: public void foo(int a, int b). Which
of the following method calls is legal?
a) foo(, 2 * 3);
b) foo(0, 0.1);
c) foo(0);
d) foo(1 + 2, 3 * 0.1);

Correct Answer: a) foo(, 2 * 3);
Rationale: The method expects two integer arguments. Option a evaluates 0/1 (which is 0)
and 2*3 (which is 6), both of which are integers. Options b and d attempt to pass a double
(0.1) to an int parameter. Option c provides only one argument.

Question 3: What is the superclass of every class in Java?
a) Main
b) String

, c) Object
d) Class

Correct Answer: c) Object
Rationale: The Java class hierarchy is rooted at the java.lang.Object class. Every class in Java,
whether explicitly stated or not, directly or indirectly extends the Object class.

Question 4: A variable declared to be of one class type can later reference an object of a
subclass of that class. This is known as a:
a) Protected variable
b) Cloneable variable
c) Polymorphic variable
d) Derivative variable

Correct Answer: c) Polymorphic variable
Rationale: Polymorphism allows a variable of a superclass type to hold a reference to an
object of any of its subclasses. This enables dynamic method dispatch, where the specific
method executed is determined at runtime based on the actual object type, not the variable
type.

Question 5: Which of the following statements is completely true regarding abstract
classes?
a) If a class is declared abstract, all methods in it must be abstract.
b) If a class is declared abstract, all instance variables must be overridden in a concrete
subclass.
c) If a class is declared abstract, some methods in the class may have their bodies omitted.
d) If a class is declared abstract, it cannot have any concrete methods.

Correct Answer: c) If a class is declared abstract, some methods in the class may have their
bodies omitted.
Rationale: An abstract class is a class that cannot be instantiated. It can contain a mix of
abstract methods (without a body) and concrete methods (with a body). Abstract methods
are intended to be implemented by non-abstract subclasses.

Question 6: In order for a class to use an interface, the class must use the keyword:
a) extends
b) inherits
c) implements
d) realizes

Correct Answer: c) implements
Rationale: In Java, the implements keyword is used by a class to indicate that it is providing
concrete implementations for all abstract methods declared in the specified interface. A
class can implement multiple interfaces.

Document information

Uploaded on
May 2, 2026
Number of pages
9
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$18.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
1
Followers
0
Items
129
Last sold
5 months ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions