Interfaces
- AutoCloseable and Flushable are part of which package?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Autocloseable is a part of java.lang; Flushable is a part of java.io.
- Does close() implicitly flush() the stream.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
close() closes the stream but it flushes it first.
- Which version of java added Flushable interface?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Flushable and Closeable interface are added in java SE 5.
- What is the use of Flushable interface?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Flushable interface provides flush() method which Flushes this stream by writing any buffered output to the underlying stream.
- What is the difference between AutoCloseable and Closeable?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Closeable extends AutoCloseable and both are interfaces. Closeable throws IOException and AutoCloseable throws Exception.