NEW
Font size
WorksheetsJAVA QUIZ
Total questions: 15
Worksheet time: 9mins
Which protocol is reliable and connection-oriented in network programming?
A) UDP
B) HTTP
C) TCP
D) IP
Which Java class is used to represent IP addresses?
A) Socket
B) ServerSocket
C) URLConnection
D) InetAddress
Which method is used to establish a connection in the Socket class?
A) openConnection()
B) accept()
C) connect()
D) getInputStream()
Which protocol is lightweight and connectionless in network programming?
A) TCP
B) FTP
C) UDP
D) SMTP
Which class is used to create a TCP server in Java?
A) ServerSocket
B) Socket
C) DatagramSocket
D) URLConnection
Which method is used to send data over a TCP socket?
A) send()
B) write()
C) transmit()
D) OutputStream()
Which class is used to create a UDP server in Java?
A) DatagramSocket
B) ServerSocket
C) Socket
D) URLConnection
Which Java class is used for handling HTTP connections and requests?
A) URLConnection
B) Socket
C) HttpURLConnection
D) ServerSocket
Which package in Java provides support for asynchronous networking?
Which class is used for non-blocking I/O operations in Java NIO?
A) Socket
B) DatagramSocket
C) Selector
D) ServerSocket
Which method is used to read data from a TCP socket?
A) send()
B) write()
C) receive()
D) InputStream()
Which Java library is commonly used for network communication in a client-server architecture?
A) Apache HttpClient
B) Netty
C) Spring Web
D) All of the above
Which method is used to establish a connection in the HttpURLConnection class?
A) openConnection()
B) accept()
C) connect()
D) getInputStream()
Which class is used to handle datagram-based communication in Java?
A) DatagramSocket
B) ServerSocket
C) Socket
D) URLConnection
