My Report (&Account)

Advanced Java Online Test – 1


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. Does close() implicitly flush() the stream.

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

3. AutoCloseable and Flushable are part of which package?

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

5. Autocloseable was introduced in which Java version?

6. What is the difference between AutoCloseable and Closeable?

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. Which of the below is a child interface of Autocloseable?

9. Which version of java added Flushable interface?

10. What is the use of Flushable interface?


 

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

advertisement
advertisement
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.