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

Java Exam Questions with 100% Verified Correct Answers 2026

Document preview thumbnail
Preview 4 out of 40 pages

Java Exam Questions with 100% Verified Correct Answers 2026 If you overwrite clone(), which 3 rules must this method obey? - Correct Answer 1) the new object should be new: memory address should differ 2) Both should be an object of the same class 3) Both should be in the same state: ().equals(a) == true Why do we need to implement the Clonable interface? - Correct Answer At runtime it would throw the CloneNotSupportedException if we don't implement the Cloneable interface. A class implements the Cloneable interface to indicate to the O() method that it is legal for that method to make a field-for-field copy of instances of that class. What is a marker interface? - Correct Answer A Marker interface, has no method. Serializable, Clonable are marker interfaces. How do you clone an object? - Correct Answer MyClone a = (MyClone) () - TypeCast is nessesary. - handle CloneNotSupportedException Why can Annotations replace marker interfaces? - Correct Answer Annotations can convey metadata about the class to its consumers without creating a separate type for it. Annotations let you pass information to classes that "consume" it. What is Double-Checked Locking? - Correct Answer To reduce the overhead of acquiring a lock by first testing the locking criterion without actually acquiring the lock. How do you make an object serializable? - Correct Answer The class must implement the .Serializable interface Java object serialization is performed using which classes? - Correct Answer Java object serialization (writing) is done with the ObjectOutputStream and deserialization (reading) is done with the ObjectInputStream. What is serialVersionUID? - Correct Answer In addition to implementing the Serializable interface, a class intended for serialization should also contain a private static final long variable named serialVersionUID. The serialVersionU


Document information

Uploaded on
February 18, 2026
Number of pages
40
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$11.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.
Winfred
3.9
(169)
Sold
807
Followers
474
Items
8610
Last sold
15 hours 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

Whoops! We can’t load your doc right now. Try again or contact support.