0% found this document useful (0 votes)
22 views4 pages

Unit 4 Nw Basics

Uploaded by

Prajakta Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views4 pages

Unit 4 Nw Basics

Uploaded by

Prajakta Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Rayat Shikshan Sanstha’s

KARMAVEER BHAURAO PATIL POLYTECHNIC


Department of Information Technology
Advanced Java Programming
MCQ

UNIT 4 N/W Basics

1. UDP stands for


a) User Data Port
b) b. User Datagram Protocol
c) c. Used Data Provider
d) d. User Data Protocol

2. IPv6 uses .
a) 4 groups of 8 bits each
b) 4 group of 8 hexa‐ decimal digits
c) 8 groups of 4 digits each
d) 8 groups of 4 hexa‐ decimal digits each

3. Communication using TCP protocol is and .


a) Connection less, Iterative
b) Collection less, concurrent
c) Connection oriented, Iterative
d) Connection oriented, concurrent

4. Name the class which is used to create a port where the server will listen.
(a) Server (b) Socket (c) ServerSocket (d) SocketServer

5.Which of these is a not a factory method of InetAddress class?


a) static InetAddress getLocalHost( )
b) static InetAddress getByName(String hostname)
c) static InetAddress getAllName(String hostname)
d) static InetAddress[ ] getAllByName(String hostname)

6. Which from the below use “Middle tier”.


a. 3 tier b. 4 tier c. n ‐ tier d. d. all of the above

7. What is the use of WriteUTF( ) method?


a) This method writes a string into underlying output stream.
b) This method reads a sting from underlying input stream.
c) This method writes a byte array into underlying output stream.
d) This method writes a character array into underlying output stream.
8. Which of these is a bundle of information passed between machines?
a. MIME b. Cache c. Datagram d. Socket

9. int getServerPort( ) method


a) returns the port number on which this request was received.
b) returns the port name on which the request was received.
c) returns the server number on which this request was received.
d) returns the port number on which this response/request was received.

10. In this constructor ServerSocket(int port, int


max_queue) what is the default value for
max_queue? a. 100 b. 50 c.
75 d. 80

11. The constructor of URL can throw an exception called


a) MalformedUrlException
b) UrlNotFoundException
c) UrlException
d) UrlSourceNotFoundException

12. Which IP address is multicast IP address?


a. 192.168.2.32 b. 235.55.45.2 c. 12.22.1.2 d. None of these

13. How many ports


of TCP/IP are
reserved for specific
protocols? a. 10 b. 1024 c. 2048 d. 512

14. How many bits are in a single IP address?


a. 8 b. 16 c. 32 d. 64

15. Which of these is a full form of DNS?


a. Data Network Service b. Data Name Service c. Domain Network
Service d. Domain Name Service

16. Which of these class is used to encapsulate IP address and DNS?


a. DatagramPacket b. URL c. InetAddress d. ContentHandler

17. Network programming in any language definitely needs to deal with and .
a. user names; port numbers b. IP addresses; link‐ layer
address c. IP addresses; port numbers d.
None of the choices are correct
18. The class used in Java network programming for socket address is the
class.

a. InetAddress b. Socket address


c. InetSocketAddress d. None of the choices are correct

19. Which of the following protocol follows connection less service?


a. TCP b. TCP/IP c. UDP d. HTTP

20. Which method is establish a connection between server and client?


a. accept() b. open() c).getLocalHost() d. openConnection()

21. Which of these package contains classes and interfaces for networking?
A. java.io B. java.util C. java.net D. javax.swing

22. In the following URL, identify the protocol identifier?


https://mcqmate.com:8080/course.php
A. https B. php C. //mcqmate.com:80/course.php D. 8080

23. Which 5 parameters uniquely identify a connection?

a. Local IP, Remote IP, Local MAC, Remote MAC and Protocol
b. Local IP, Local PORT, Remote MAC, Remote PORT and Protocol
c. Local MAC, Local PORT, Remote MAC, Remote PORT and Protocol
d. Local IP, Local PORT, Remote IP, Remote PORT and Protocol

24. Which of the following statement is NOT true?

A. TCP is a reliable but slow.


B. UDP is not reliable but fast.
C. In HTTP, all communication between two computers are encrypted
D. File Transfer Protocol (FTP) is a standard Internet protocol for transmitting files
between computers on the Internet over TCP/IP connections. McqMate.com

25. Which of the following statement is TRUE?

A. With stream sockets there is no need to establish any connection and data flows
between the processes are as continuous streams.
B. Stream sockets are said to provide a connection‐ less service and UDP protocol
is used
C. Datagram sockets are said to provide a connection‐ oriented service and TCP
protocol is used
D. With datagram sockets there is no need to establish any connection and data
flows between the processes are as packets.
26. Which of the following method call is valid to obtain the server's hostname by
invoking an applet?

A. getCodeBase().host() B. getCodeBase().getHost() C.
getCodeBase().hostName() D. getCodeBase().getHostName()

27. The server listens for a connection request from a client using which of the
following statement?

A. Socket s = new Socket(ServerName, port); B. Socket s =


serverSocket.accept()
C. Socket s = serverSocket.getSocket() D. Socket s = new Socket(ServerName);

28. The client requests a connection to a server using which of the following
statement?

A. Socket s = new Socket(ServerName, port); B. Socket s =


serverSocket.accept();
C. Socket s = serverSocket.getSocket(); D. Socket s = new Socket(ServerName);

29. To connect to a server running on the same machine with the client, which of
the following cannotbe used for the hostname?

A. “localhost” B. "127.0.0.1" C. InetAddress.getLocalHost(),


D. "127.0.0.0"

30. In the socket


programming, for an IP address, which can be used to find the
host name and IP address of a client/ server?

A. The ServerSocket class B. The Socket class


C. The InetAddress class D. The Connection interface

31. To create an InputStream on a socket, say s, which of the following statement is


necessary?
A. InputStream in = new InputStream(s); B. InputStream in =
s.getInputStream();
C. InputStream in = s.obtainInputStream(); D. InputStream in = s.getStream();

32. Which of the following protocols is/are for splitting and sending packets to an
address across a network?
A. TCP/IP B. FTP C. SMTP D. UDP

You might also like