Professional Documents
Culture Documents
2 Mcqssiy821
2 Mcqssiy821
2. How do you create a server socket in Java? A) new ServerSocket() B) new Socket() C)
ServerSocket.createServer() D) Socket.openServer()
3. Which method is used to read data from a Socket in Java? A) read() B) receive() C)
readLine() D) getData()
4. Which method is used to send data through a Socket in Java? A) send() B) write() C)
sendData() D) writeBytes()
5. What is the purpose of the InputStream and OutputStream classes in socket programming?
A) To handle network connections B) To handle file I/O operations C) To read and write data
to and from a socket D) To perform encryption and decryption