Java Programming Flashcards
6 cards from real IKM practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Java Programming flashcards as text
What is the result of comparing two distinct String objects created with `new String("abc")` using the `==` operator?
Answer: false, because == compares object references
For objects, == compares references. Two separate objects made with `new` are different references even when the contents match. Use equals() to compare contents.
Which keyword prevents a method from being overridden in a subclass?
Answer: final
A method declared final cannot be overridden by subclasses. A final class cannot be extended at all.
Which collection class stores unique elements and does NOT guarantee any particular iteration order?
Answer: HashSet
HashSet implements Set, so it rejects duplicates, and it is backed by a hash table that gives no ordering guarantee. ArrayList and LinkedList allow duplicates.
Which of the following is a checked exception in Java?
Answer: IOException
IOException extends Exception but not RuntimeException, so the compiler requires it to be caught or declared. The other three are unchecked RuntimeExceptions.
What does the `finally` block do in a try-catch-finally statement?
Answer: Runs whether or not an exception occurs, in nearly all cases
The finally block normally runs whether or not an exception is thrown or caught, which makes it the usual place for cleanup. It does not run if the JVM exits first, for example through System.exit().
Which interface must a class implement so that its instances can be run by a new Thread?
Answer: Runnable
Runnable declares run(), which a Thread executes. You can pass a Runnable to the Thread constructor or extend Thread directly.
Written and edited by Nathan Beja, founder of Practice Test Geeks, with AI assistance. Exam facts are checked against the official sources linked below. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- ikmnet.com — Test delivery, passing score · verified Oct 2026
- online.ikmnet.com — Eligibility, exam format, retake policy, score release, time limit · verified Oct 2026