Advanced Java Programming (3160707) MCQs

MCQs of Java Networking

Showing 11 to 20 out of 21 Questions
11.
Which is not true for socket.
(a) Socket connection means the two machines have information about each other’s network location and port.
(b) Socket supports only TCP protocol due to its reliability feature.
(c) To connect to other machine we need a socket connection.
(d) Socket programming is used for communication between the applications running on different JRE.
Answer:

Option (b)

12.
If one want to implement Socket at client side then which is the correct way to implement it?
(a) ServerSocket ss=new ServerSocket(port);
(b) Socket s=ss.accept();
(c) Socket s=new Socket("localhost",port);
(d) Socket s=ss.accept(port);
Answer:

Option (c)

13.
URL contains…?
(a) Protocol
(b) IP Address
(c) Port Number
(d) All of these
Answer:

Option (d)

14.
InetAddress has a cache to store successful and unsuccessful host name resolutions.
(a) True
(b) False
Answer:

Option (a)

15.
Datagram is basically an information but there is no guarantee of its
(a) content
(b) arrival & arrival time
(c) A & B both
(d) None of these
Answer:

Option (c)

16.
DatagramSocket() throws
(a) IOException
(b) UnknownHostException
(c) ClassNotFoundException
(d) SocketException
Answer:

Option (d)

17.
UnknownHostException is immediate child class of_______?
(a) java.lang.Exception
(b) java.lang.IOException
(c) java.lang.Throwable
(d) java.lang.Object
Answer:

Option (b)

18.
Port numbers range from _____ to ______.
(a) 0 to 65535
(b) 1 to 65536
(c) -65535 to 65536
(d) 0 to 1024
Answer:

Option (a)

19.
_________ Protocol is more efficient in terms of both latency and bandwidth.
(a) TCP
(b) UDP
(c) SMTP
(d) FTP
Answer:

Option (b)

20.
Which of the following is NOT true about User Datagram Protocol in transport layer?
(a) Works well in unidirectional communication, suitable for broadcast information.
(b) It does three way handshake before sending datagrams.
(c) It provides datagrams, suitable for modeling other protocols such as in IP tunneling or Remote Procedure Call and the Network File System.
(d) The lack of retransmission delays makes it suitable for real-time applications.
Answer:

Option (b)

Showing 11 to 20 out of 21 Questions