My Report

Advanced Java Online Test – 2


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What is the use of Flushable interface?

2. Which version of java added Flushable interface?

3. What is the difference between AutoCloseable and Closeable?

4. Autocloseable was introduced in which Java version?

5. Which of the below is a child interface of Autocloseable?

6. What is the alternative of using finally to close resource?

7. What will be the output of the following Java code snippet?

try (InputStream is = ...) 
{
    // do stuff with is...
} 
catch (IOException e) 
{
    // handle exception
}

8. It is a good practise to not throw which exception in close() method of autocloseable?

9. AutoCloseable and Flushable are part of which package?

10. Does close() implicitly flush() the stream.


 

Start practicing “1000 MCQs on Java”, and once you are ready, you can take tests on all topics by attempting our “Java Test Series”.

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.