AutoCloseable, Closeable and Flushable Interfaces Online Exam Quiz
AutoCloseable, Closeable and Flushable Interfaces GK Quiz. Question and Answers related to AutoCloseable, Closeable and Flushable Interfaces. MCQ (Multiple Choice Questions with answers about AutoCloseable, Closeable and Flushable Interfaces
AutoCloseable and Flushable are part of which package?
Options
A : Autocloseable java.lang; Flushable java.io
B : Autocloseable java.io; Flushable java.lang
C : Autocloseable and Flushable java.io
D : Autocloseable and Flushable java.lang
Does close() implicitly flush() the stream.
Options
A : TRUE
B : FALSE
C : -
D : -
How does applet and servlet communicate?
Options
A : HTTP
B : HTTPS
C : FTP
D : HTTP Tunneling
In CGI, process starts with each request and will initiate OS level process.
Options
A : TRUE
B : FALSE
C : -
D : -
What does bind() method of ServerSocket offer?
Options
A : binds the serversocket to a specific address (IP Address and port)
B : binds the server and client browser
C : binds the server socket to the JVM
D : binds the port to the JVM
What happens if ServerSocket is not able to listen on the specified port?
Options
A : The system exits gracefully with appropriate message
B : The system will wait till port is free
C : IOException is thrown when opening the socket
D : PortOccupiedException is thrown
What is the difference between AutoCloseable and Closeable?
Options
A : Closeable is an interface and AutoCloseable is a concrete class
B : Closeable throws IOException; AutoCloseable throws Exception
C : Closeable is a concept; AutoCloseable is an implementation
D : Closeable throws Exception; AutoCloseable throws IOException
What is the use of Flushable interface?
Options
A : Flushes this stream by writing any buffered output to the underlying stream
B : Flushes this stream and starts reading again
C : Flushes this connection and closes it
D : Flushes this stream and throws FlushException
Which class provides system independent server side implementation?
Options
A : Socket
B : ServerSocket
C : Server
D : ServerReader
Which version of java added Flushable interface?
Options
A : java SE 7
B : java SE 8
C : java SE 6
D : java SE 5