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 4 out of 75 pages
Exam (elaborations)

CSE 205 Final Exam Prep 2026: 150 Practice Questions & Complete Rationales | OOP Principles | Stacks Queues BST | Sorting Searching | Inheritance Polymorphism | Java Programming

Document preview thumbnail
Preview 4 out of 75 pages

CSE 205 Final Exam Prep 2026: 150 Practice Questions & Complete Rationales | OOP Principles | Stacks Queues BST | Sorting Searching | Inheritance Polymorphism | Java Programming CSE 205 (Object Oriented Programming and Data Structures). Questions cover all major topics including OOP principles (inheritance, polymorphism, encapsulation), data structures (stacks, queues, linked lists, trees, ArrayLists), algorithms (sorting, searching, recursion), exception handling, and software development processes. Each question includes the correct answer and a detailed rationale based on standard Java programming concepts.

Content preview

CSE 205 Final Exam Prep 2026: 150 Practice Questions &
Complete Rationales | OOP Principles | Stacks Queues BST |
Sorting Searching | Inheritance Polymorphism | Java
Programming


Here is a comprehensive 150-question practice exam for CSE 205 (Object-
Oriented Programming and Data Structures). Questions cover all major topics
including OOP principles (inheritance, polymorphism, encapsulation), data
structures (stacks, queues, linked lists, trees, ArrayLists), algorithms (sorting,
searching, recursion), exception handling, and software development processes.
Each question includes the correct answer and a detailed rationale based on
standard Java programming concepts.




Section 1: Object-Oriented Programming Principles (Questions 1-30)
1. 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

Rationale: A class is a blueprint or template that defines the structure and
behavior of objects. An object is a specific instance of a class created in memory
using the new keyword. You can create multiple objects from a single class .
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

Rationale: Java naming conventions dictate that class names should begin
with an uppercase letter and use CamelCase. Classes should typically be
declared public to allow access from other files. The name should be meaningful
and descriptive .
3. 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

Rationale: The new keyword is used to allocate memory and create a new
object (instance) of a class. For example: Car myCar = new Car(); .
4. What does acronym API stand for?
 A) Application Parameter Internet
 B) Application Programming Interface
 C) Apply Programming Interactive
 D) Abstraction Programming Interface

,Answer: B – Application Programming Interface

Rationale: An API is a set of rules, protocols, and tools for building software
applications. In Java, the Java API is a collection of pre-written classes, packages,
and interfaces that provide ready-to-use functionality .
5. 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
Answer: A – how an object is initialized

Rationale: A constructor is a special method that has the same name as the
class and no return type. It is automatically called when an object is created and is
used to initialize the object's instance variables to appropriate initial values .
6. Which of the following is true regarding subclasses?
 A) A subclass has access to private instance variables of its superclass.
 B) A subclass does not have access to public instance variables of its
superclass.
 C) A subclass must specify the implicit parameter to use methods inherited
from its superclass.
 D) A subclass has NO access to private instance variables of its superclass.
Answer: D – A subclass has NO access to private instance variables of its
superclass

Rationale: private members of a superclass are not accessible directly in a
subclass. Subclasses can only directly access public and protected members. To
access private members, subclasses must use public or protected getter/setter
methods provided by the superclass .

, 7. A class that represents a more specific entity in an inheritance hierarchy is
called a/an:
 A) Default Class
 B) Superclass
 C) Subclass
 D) Inheritance class
Answer: C – Subclass

Rationale: In inheritance, the subclass (also called derived class or child class)
extends the superclass and represents a more specialized version. For example,
if Vehicle is a superclass, Car would be a subclass representing a more specific
entity .
8. You are creating a class inheritance hierarchy about motor vehicles that will
contain classes named Vehicle, Auto, and Motorcycle. Which of the following
statements is correct?
 A) Vehicle should be the default class, while Auto and Motorcycle should be
the subclasses.
 B) Vehicle should be the superclass, while Auto and Motorcycle should be
the subclasses.
 C) Vehicle should be the subclass, while Auto and Motorcycle should be the
superclasses.
 D) Vehicle should be the subclass, while Auto and Motorcycle should be the
default classes.
Answer: B – Vehicle should be the superclass, while Auto and Motorcycle should
be the subclasses

Rationale: In an inheritance hierarchy, the more general class (Vehicle) is the
superclass, and more specific classes (Auto, Motorcycle) are subclasses that
inherit from the superclass. This follows the "is-a" relationship: an Auto is a
Vehicle .

Document information

Uploaded on
May 4, 2026
Number of pages
75
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
£22.65

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

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Masterwritters
3.8
(30)
Sold
162
Followers
6
Items
2061
Last sold
2 days ago




Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed 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