Forums Register Login

Java 8 exam - which classes implement Closeable?

+Pie Number of slices to send: Send
Hi, I know that IO classes implement the Closeable interface, and I agree that learning things for an exam isn't the best way to go, but I'm curious: is there a list of classes in Java 8 that implement Closeable?

Am I going to have to go into the exam knowing just those that I've looked at in the OCP book by Oracle?
1
+Pie Number of slices to send: Send
Anupam,
Welcome to CodeRanch!

The JavaDoc lists the Java 8 classes that come with the JDK that implement Closable. Luckily, you don't need to know most of them for the exam!The study guides distill what you need to know for the exam.

Also, the JDBC classes like ResultSet implement AutoCloseable. There's a list for that too.
+Pie Number of slices to send: Send
Thanks very much Jeanne!  Loved your book, by the way!

This reminds me to check the Javadoc before I post elementary questions...
(1 cow) 4
+Pie Number of slices to send: Send
 

Anupam Banerji wrote:Hi, I know that IO classes implement the Closeable interface, and I agree that learning things for an exam isn't the best way to go, but I'm curious: is there a list of classes in Java 8 that implement Closeable?

Am I going to have to go into the exam knowing just those that I've looked at in the OCP book by Oracle?



First off, you probably need AutoCloseable, not Closeable

Next, open Eclipse, Shift + Ctrl + T type AutoCloseable

Then F4

Enjoy the list (see attached)





2.png
AutoCloseable hierarchy
[2.png]
+Pie Number of slices to send: Send
@Mikalai Zaikin:  Fantastic!  Thanks very much!
permaculture is giving a gift to your future self. After reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6028 times.
Similar Threads
Which exam should i take OCAJ 7 or OCAJ 8?
How accurate is the Oracle published exam topics syllabus?
1Z0-803 (OCA SE 7 Programmer) to 1Z0-809 (OCP SE 8 programmer)
OCPJP Java 8 Jeanne Boyarsky & Scott Selikoff (Exam guide book)
Cleared OCA java 8 certification and need preparation inputs for OCP java 8 exam
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:11:47.