Which method is used to retrieve the InputStream of a Socket object?
- getInputStream()
- getOutputStream()
- getSocketInputStream()
- openInputStream()
In Java, you can retrieve the InputStream of a Socket object using the getInputStream() method. This input stream allows you to read data from the socket. The other options are not used for retrieving the input stream of a socket.
Loading...
Related Quiz
- What will be the outcome if you try to execute a DML (Data Manipulation Language) operation using executeQuery() method?
- The ______ method of the Lock interface is used to acquire the lock.
- When a thread acquires a lock for a synchronized method, it ________ the entry of other threads for all synchronized methods.
- Which of the following is true regarding the flow of control in a try-catch-finally statement?
- Imagine that you are building a Java application to download files from an FTP server. How would you establish a connection and ensure the secure transmission of files from the server to your application?