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 12 pages
Exam (elaborations)

CSE205 Exam2 Study Guide Questions with Correct Answers | Updated (100% Correct Answers)

Document preview thumbnail
Preview 2 out of 12 pages

CSE205 Exam2 Study Guide Questions with Correct Answers | Updated (100% Correct Answers)

Content preview

1


CSE205 Exam2 Study Guide Questions with
Correct Answers | Updated (100% Correct
Answers)
What is a polymorphic reference, and when are they resolved?—
Answer: A polymorphic reference is a reference variable that can
refer to different types of objects at different points in time.
Polymorphic references are resolved at run-time, not during
compilation.

Example: Pet myPet;

myPet = new Dog(); OR myPet = new Cat();

What is the comparable interface used for?— Answer: Java
Comparable interface is used to sort or order the objects of a user-
defined class, since Comparable cannot sort the objects on its own.

What is the signature of the method that

needs to be defined by the implementing the class?— Answer: int
compareTo(T object)

What methods do you use to get the location of the mouse when
implementing Mouse




© 2025 All rights reserved

, 2
Event?— Answer: Point point = event.getPoint(); or event.getX() &
event.getY();

What is an interface; can a class implement multiple interfaces?—
Answer: A java interface is a collection of abstract methods and
constants. A class

that implements an interface must define a definition for each
method in the interface.

Yes. A class can implement multiple interfaces.

If a class implements

the Comparator interface then it should implement what method?—
Answer: The compare method, int compare(T Object1, T Object2)

How do you draw a line?— Answer: Line line = new Line(startX,
startY, endX, endY);

How do you draw a circle?— Answer: Circle circle = new
Circle(centerX, centerY, radius);

How do you draw a text?— Answer: Text text = new Text(stratX,
startY, stringToDisplay);

When drawing a rectangle,

Rectangle r1 = new Rectangle(A, B, C, D);

© 2025 All rights reserved

Document information

Uploaded on
January 16, 2026
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.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

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.
Passit
3.5
(23)
Sold
128
Followers
6
Items
14482
Last sold
2 weeks 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