Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Unit -IV Networking Basics

CO-4 Develop Java programs using networking concepts


MCQ question bank

Sr. Question Bloom Marks


No Level
1 Which of these package contains classes and interfaces for networking? R 1
a) java.io
b) java.util
c) java.net
d) java.network

Answer: c
Explanation: java.net these package contains classes and interfaces for networking.
2 Which of these is a protocol for breaking and sending packets to an address across a network? R 1
a) TCP/IP
b) DNS
c) Socket
d) Proxy Server

Answer: a
Explanation: TCP/IP – Transfer control protocol/Internet Protocol is used to break data into
small packets an send them to an address across a network.
3 How many ports of TCP/IP are reserved for specific protocols? A 1
a) 10
b) 1024
c) 2048
d) 512

Answer: b
Explanation:1024 ports of TCP/IP are reserved for specific protocols.
4 How many bits are in a single IP address? R 1
a) 8
b) 16
c) 32
d) 64

Answer: c
Explanation: 32 bits are in a single IP address.
5 Which of these is a full form of DNS? U 1
a) Data Network Service
b) Data Name Service
c) Domain Network Service
d) Domain Name Service

Answer: d
Explanation:DNS is the Domain Name Service.
6 Which of these class is used to encapsulate IP address and DNS? R 1
a) DatagramPacket
b) URL
c) InetAddress
d) ContentHandler

Answer: c
Explanation: InetAddress class encapsulate both IP address and DNS, we can interact with
this class by using name of an IP host.
7 1. import java.net.*; U 1
2. class networking
3. {
4. public static void main(String[] args) throws UnknownHostException
5. {
6. InetAddress obj1 = InetAddress.getByName("sanfoundry.com");
7. InetAddress obj2 = InetAddress.getByName("sanfoundry.com");
8. boolean x = obj1.equals(obj2);
9. System.out.print(x);
10. }
11. }
a) 0
b) 1
c) true
d) false

Answer: c
Explanation: Output :javac networking.java
Java networking
true
8 URL is an acronym for? U
a. Uniform Resource Locator
b. Unified Resource Locator
c. Uniform Restore Locator
d. Unified Restore Locator

ANSWER: Uniform Resource Locator


Explanation: URL is Uniform Resource Locator.
9 URL stands for Uniform Resource Locator and represents a resource on the World Wide Web, such as a Web page U 1
or FTP directory.
a. True
b. False

Answer: a
Explanation: URL represents a resource on the World Wide Web, such as a Web page or FTP directory.
10 Which class is used to create servers that listen for either local client or remote client programs? U 1
a. ServerSockets
b. httpServer
c. httpResponse
d. None of the above
Answer: a
Explanation: ServerSockets class is used to create servers that listen for either local client or remote client
programs.
11 Which constructor of DatagramSocket class is used to creates a datagram socket and binds it with the given Port U 1
Number?
a. DatagramSocket(int port)
b. DatagramSocket(int port, InetAddress address)
c. DatagramSocket()
d. None of the above

Answer: DatagramSocket(int port, InetAddress address)


Explanation: DatagramSocket(int port, InetAddress address) constructor of DatagramSocket class is used to create
a datagram socket and binds it with the given Port Number.
12 Which methods are commonly used in ServerSocket class? R 1
a. public OutputStream getOutputStream()
b. public Socket accept()
c. public synchronized void close()
d. None of the above

Answer: public Socket accept()


Explanation:public Socket accept() methods are commonly used in ServerSocket class.

13 Which classes are used for connection-less socket programming? R 1


a. DatagramSocket
b. DatagramPacket
c. Both A & B
d. None of the above

Answer: Both A & B


Explanation: DatagramSocket and . DatagramPacket are used for connection-less socket programming.
14 Which method of URL class represents a URL and it has complete set of methods to manipulate URL in Java? R 1
a. java.net.URL
b. java.net.URLConnection
c. Both A & B
d. None of the above

Answer: b
Explanation: java.net.URL method represents a URL and it has complete set of methods to manipulate the URL in
Java.
15 Which class is used to create servers that listen for either local client or remote client programs? R 1
a. ServerSockets
b. httpServer
c. httpResponse
d. None of the above

Answer: ServerSockets
Explanation: ServerSockets is used to create servers that listen for either local client or remote client programs.
16 Which package provides core functionality? U 1
a. java.net
b. java.rmi
c. java.lang
d. java.math

Answer: java.lang
Explanation: java.lang provides core functionality.
17 The DatagramSocket and DatagramPacket classes are not used for connection-less socket programming. U 1
a. True
b. False
Answer: False
Explanation: DatagramSocket and DatagramPacket classes are used for connection-less socket programming
18 Give the abbrevation of BSD. R 1
a. Berkeley Software Distribution
b. Berkeley Socket Distribution
c. Berkeley System Distribution
d. None of the above
Answer: Berkeley Software Distribution
Explanation: BSD is the Berkeley Software Distribution
19 The client in socket programming must know which informations? R 1
a. IPaddress of Server
b. Port number
c. Both A & B
d. None of the above

Answer: Both A & B


Explanation: IPaddress of Server and Port number information must know for client in socket programming.
20 The URLConnection class can be used to read and write data to the specified resource referred by the URL R 1
a. True
b. False

Answer: True
Explanation: The URLConnection class can be used to read and write data to the specified resource referred by the
URL.
21 Datagram is basically an information but there is no guarantee of its content, arrival or arrival time. R 1
a. True
b. False

Answer: True
Explanation: Datagram is basically an information but there is no guarantee of its content, arrival or arrival time

22 What does the java.net.InetAddress class represent? U 1


a. Socket
b. IP Address
c. Protocol
d. MAC Address
Answer: b.IP Address
Explanation: The java.net.InetAddress class represent IP Address.
23 The flush() method of PrintStream class flushes any uncleared buffers in memory R 1
a. True
b. False
Answer: True
Explanation: The flush() method of PrintStream class flushes any uncleared buffers in memory.
24 TCP,FTP,Telnet,SMTP,POP etc. are examples of ? U 1
a. Socket
b. IP Address
c. Protocol
d. MAC Address

Answer: Protocol
Explanation: Protocol contains TCP,FTP,Telnet,SMTP,POP.
25 Which steps occur when establishing a TCP connection between two computers using sockets? R 1
a. The server instantiates a ServerSocket object, denoting which port number communication is to occur on
b. The server invokes the accept() method of the ServerSocket class. This method waits until a client connects to
the server on the given port
c. After the server is waiting, a client instantiates a Socket object, specifying the server name and port number to
connect to
d. All of the above

Answer:All of the above


Explanation: All steps occur when establishing a TCPconnection between two computers using sockets
26 In InetAddress class which method returns the host name of the IP Address? U 1
a. public String getHostName()
b. public String getHostAddress()
c. public static InetAddress getLocalHost()
d. None of the above

Answer: public String getHostName()


Explanation: public String getHostName()method returns the host name of the IP Address.
27 How long is an IPv6 address? R 1
a)32 bits
b)128 bytes
c)64 bits
d)128 bits

Answer: d)
Explanation:An IPv6 address is 128 bits long.
28 What flavor of Network Address Translation can be used to have one IP address allow many users to connect to the R 1
global Internet?
a)NAT
b)Static
c)Dynamic
d)PAT
Answer: d)
Explanation:Port Address Translation (PAT) allows a one-to-many approach to network address translation.
29 What are the two main types of access control lists (ACLs)? A 1
1. Standard
2. IEEE
3. Extended
4. Specialized
a)1 and 3
b)2 and 4
c)3 and 4
d)1 and 2

Answer: a)
Explanation: Standard and extended access control lists (ACLs) are used to configure security on a router.
30 What command is used to create a backup configuration? U 1
a)copy running backup
b)copy running-config startup-config
c)config mem
d)wr mem
Answer: b)
Explanation:The command to back up the configuration on a router is copy running-config startup-config.
31 You have 10 users plugged into a hub running 10Mbps half-duplex. There is a server connected to the switch U 1
running 10Mbps half-duplex as well. How much bandwidth does each host have to the server?
a)100 kbps
b)1 Mbps
c)2 Mbps
d)10 Mbps
Answer: d)
Explanation:Each device has 10 Mbps to the server.
32 Which WLAN IEEE specification allows up to 54Mbps at 2.4GHz? U 1
a)A
b)B
c)G
d)N
Answer: C
Explanation: IEEE 802.11B is 2.4GHz, but with a maximum of only 11Mbps. IEEE 802.11G is in the 2.4GHz
range, with a top speed of 54Mbps.
33 Which of the following is the valid host range for the subnet on which the IP address 192.168.168.188 U 1
255.255.255.192 resides?
a)192.168.168.129-190
b)192.168.168.129-191
c)192.168.168.128-190
d)192.168.168.128-192
Answer: a)
Explanation:256 - 192 = 64. 64 + 64 = 128. 128 + 64 = 192. The subnet is 128, the broadcast address is 191, and
the valid host range is the numbers in between, or 129-190.
34 To back up an IOS, what command will you use? U
a)backup IOS disk
b)copy ios tftp
c)copy tftp flash
d)copy flash tftp
Answer: d)
Explanation:The command copy flash tftp will prompt you to back up an existing IOS in flash to a TFTP host.
35 What protocol does PPP use to identify the Network layer protocol? U 1
a)NCP
b)ISDN
c)HDLC
d)LCP
Answer: a)
Explanation:Network Control Protocol is used to help identify the Network layer protocol used in the packet.
36 Which of the following commands will allow you to set your Telnet password on a Cisco router? U 1
a)line telnet 0 4
b)line aux 0 4
c)line vty 0 4
d)line con 0

Answer: c)
Explanation:The command line vty 0 4 places you in a prompt that will allow you to set or change your Telnet
password.
37 Which protocol does DHCP use at the Transport layer? R 1
a)IP
b)TCP
c)UDP
d)ARP
Answer: c)
Explanation:User Datagram Protocol is a connection network service at the Transport layer, and DHCP uses this
connectionless service.
38 Which command is used to determine if an IP access list is enabled on a particular interface? U 1
a)show access-lists
b)show interface
c)show ip interface
d)show interface access-lists
Answer: c)
Explanation:The show ip interface command will show you if any outbound or inbound interfaces have an access
list set.
39 Where is a hub specified in the OSI model? R 1
a)Session layer
b)Physical layer
c)Data Link layer
d)Application layer

Answer: b)
Explanation: Hubs regenerate electrical signals, which are specified at the Physical layer.
40 What does the passive command provide to dynamic routing protocols? U 1
a)Stops an interface from sending or receiving periodic dynamic updates.
b)Stops an interface from sending periodic dynamic updates but not from receiving updates.
c)Stops the router from receiving any dynamic updates.
d)Stops the router from sending any dynamic updates
.
Answer: b)
Explanation:
The passive command, short for passive-interface, stops regular updates from being sent out an interface. However,
the interface can still receive updates.
41 Which protocol is used to send a destination network unknown message back to originating hosts? R 1
a)TCP
b)ARP
c)ICMP
d)BootP

Answer: c)
Explanation:ICMP is the protocol at the Network layer that is used to send messages back to an originating router.
42 How often are BPDUs sent from a layer 2 device? U 1
a)Never
b)Every 2 seconds
c)Every 10 minutes
d)Every 30 seconds

Answer: b)
Explanation:Every 2 seconds, BPDUs are sent out from all active bridge ports by default.
43 How many broadcast domains are created when you segment a network with a 12-port switch? U 1
a)1
b)2
c)5
d)12
Answer: a)
Explanation:By default, switches break up collision domains but are one large broadcast domain.
44 What does the command routerA(config)#line cons 0 allow you to perform next? R 1
a)Set the Telnet password.
b)Shut down the router.
c)Set your console password.
d)Disable console connections

Answer: c)
Explanation:The command line console 0 places you at a prompt where you can then set your console user-mode
password
45 Which router command allows you to view the entire contents of all access lists? R 1
a)show all access-lists
b)show access-lists
c)show ip interface
d)show interface

Answer: b)
Explanation:To see the contents of all access lists, use the show access-lists command.
46 Which class of IP address has the most host addresses available by default? U 1
a)A
b)B
c)C
d)A and B

Answer: a)A
Explanation:Class A addressing provides 24 bits for host addressing.
47 In a network with dozens of switches, how many root bridges would you have? A 1
a)1
b)2
c)5
d)12
Answer: a)
Explanation:
You should have only one root bridge per network.
48 What PPP protocol provides dynamic addressing, authentication, and multilink? U 1
a)NCP
b)HDLC
c)LCP
d)X.25

Answer: c)
Explanation:Link Control Protocol in the PPP stack provides dynamic addressing, authentication, and multilink.
49 What is a stub network? U 1
a)A network with more than one exit point.
b)A network with more than one exit and entry point.
c)A network with only one entry and no exit point.
d)A network that has only one entry and exit point.

Answer: d)
Explanation:Stub networks have only one connection to an internetwork. Only default routes can be set on a stub
network or network loops may occur.
50 If your router is facilitating a CSU/DSU, which of the following commands do you need to use to provide the A 1
router with a 64000bps serial link?
a)RouterA(config)#bandwidth 64
b)RouterA(config-if)#bandwidth 64000
c)RouterA(config-if)#clock rate 64
d)RouterA(config-if)#clock rate 64000

Answer: d)
Explanation:The clock rate command is two words, and the speed of the line is in bps.
51 Which one of the following is true regarding VLANs? R 1
a)Two VLANs are configured by default on all Cisco switches.
b)VLANs only work if you have a complete Cisco switched internetwork. No off-brand switches are allowed.
c)You should not have more than 10 switches in the same VTP domain.
d)VTP is used to send VLAN information to switches in a configured VTP domain.

Answer: d)
Explanation:Switches do not propagate VLAN information by default; you must configure the VTP domain.
VLAN Trunking Protocol (VTP) is used to propagate VLAN information across a trunk link.
52 What does a VLAN do? U 1
a)Acts as the fastest port to all servers.
b)Provides multiple collision domains on one switch port.
c)Breaks up broadcast domains in a layer 2 switch internetwork.
d)Provides multiple broadcast domains within a single collision domain.

Answer: c)
Explanation:VLANs break up broadcast domains at layer 2.
53 What is the main reason the OSI model was created? R 1
a)To create a layered model larger than the DoD model.
b)So application developers can change only one layer's protocols at a time.
c)So different networks could communicate.
d)So Cisco could use the model.

Answer: c)
Explanation:The primary reason the OSI model was created was so that different networks could inter-operate.
54 How many collision domains are created when you segment a network with a 12-port switch? R 1
a)1
b)2
c)5
d)12

Answer: d)
Explanation:Layer 2 switching creates individual collision domains.
55 What command will display the line, protocol, DLCI, and LMI information of an interface? R 1
a)sh pvc
b)show interface
c)show frame-relay pvc
d)show run

Answer: b) show interface


Explanation:The show interface command shows the line, protocol, DLCI, and LMI information of an interface.
56 Which protocol does Ping use? R 1
a)TCP
b)ARP
c)ICMP
d)BootP

Answer: c) ICMP
Explanation:ICMP is the protocol at the Network layer that is used to send echo requests and replies.
57 Which command is used to upgrade an IOS on a Cisco router? R 1
a)copy tftp run
b)copy tftp start
c)config net
d)copy tftp flash

Answer: d)copy tftp flash


Explanation:The copy tftp flash command places a new file in flash memory, which is the default location for the
Cisco IOS in Cisco routers.
58 If you wanted to delete the configuration stored in NVRAM, what would you type? R 1
a)erase startup
b)erase nvram
c)delete nvram
d)erase running

Answer: a)erase startup


Explanation:The command erase startup-config deletes the configuration stored in NVRAM.
59 What protocols are used to configure trunking on a switch? U 1
1. VLAN Trunking Protocol
2. VLAN
3. 802.1Q
4. ISL
a)1 and 2
b)3 and 4
c)1 only
d)2 only

Answer: b)3 and 4


Explanation:VTP is not right because it has nothing to do with trunking except that it sends VLAN information
across a trunk link. 802.1Q and ISL are used to configure trunking on a port.
60 _____ are the advantages of hierarchical routing. R 1
A. Flexibility
B. Reliability
C. Scalability
D. Portability
E. None of these
Answer: C Scalability
Explanation: Scalability are the advantages of hierarchical routing.
61 One of the following the java.net Net Address class represents. A 1
A. Socket
B. Protocol
C. IP Address
D. MAC Address
E. All of these
Answer: C. IP Address
Explanation: java.net Net Address class represents IP Address
62 ______is the Central Computer powerful than other computers in the network. U 1
A. Server
B. Hub
C. Client
D. Switch
E. Both A and B
Answer: A. Server
Explanation: Server is the Central Computer powerful than other computers in the network.
63 TCP groups a number of bytes together______in a packets. U 1
A. user datagram
B. datagram
C. segment
D. packet
E. None of these
Answer: C. segment
Explanation: TCP groups a number of bytes together_ segment in a packets.
64 one of the following classes are used for connection-less socket programming? A 1
A. Datagram Socket
B. Datagram Packet
C. Both Datagram Socket
D. Datagram Packet
E. None of these
Answer: A. Datagram Socket
Explanation: Datagram Socket are used for connection-less socket programming.
65 one of the following is a path vector routing? U 1
A. exterior gateway protocol
B. inter-domain routing
C. network routing protocol
D. All of these
Answer: C. network routing protocol
Explanation: network routing protocol is a path vector routing.
66 _______is the Machine that places the request to access the data U 1
A. Client Machine
B. Server Machine
C. Request Machine
D. None of these
Answer: B. Server Machine
Explanation: Server Machine is the Machine that places the request to access the data.
67 ______is the default port of SMTP. U 1
A. 25
B. 70
C. 80
D. 85
E. None of these
Answer: A. 25
Explanation: 25 is the default port of SMTP.
68 ____ Net Ware protocol provides link-state routing. U 1
A. SAP
B. RIP
C. NLSP
D. NCP
Answer: C. NLSP
Explanation: NLSP Net Ware protocol provides link-state routing.
69 one of the following applications of the Client and Server Model? U 1
A. Email
B. Network Printing
C. World Wide Web
D. All of these
Answer:D. All of these
Explanation: Email, Network Printing, World Wide Web are the Client and Server Model

70 IP address 200.200.200.200 is IP of which class? U 1


A. Class C
B. Class D
C. Class A
D. Class B
E. both A & B
Answer: A. Class C
Explanation: Class C contains IP address 200.200.200.200.
71 Which of the following net is the combination of two or more networks? R 1
A.MAN
B. WAN
C. Internetwork
D. None of these
Answer: C. Internetwork
Explanation: Internetwork net is the combination of two or more networks.
72 FTP is the …? R 1
A. File transmission protocol
B. File transfer protocol
C. Form transmission protocol
D. Form transfer protocol
E. None of these
Answer: B. File transfer protocol
Explanation: FTP is the File transfer protocol.
73 Which of the following topology is the multipoint topology? R 1
A. Bus
B. Star
C. Mesh
D. Ring
E. None of these
Answer: A. Bus
Explanation: . Bus topology is the multipoint topology.
74 Which services are the network services? R 1
A. Database service
B. File service
C. Print service
D. All of these

Answer: D. All of these


Explanation: Database service, File service ,Print service are the network services
75 In the communication pathway data transfers from one point to another through_____. U 1
A. Medium
B. Node
C. Link
D. All of these
Answer: C. Link
Explanation: communication pathway data transfers from one point to another through Link.
76 All devices are connected to a central hub with the help of which of the following network topology? R 1
A. Star Topology
B. Tree Topology
C. Bus Topology
D. Ring Topology
E. None of these
Answer: A. Star Topology
Explanation: devices are connected to a central hub with the help of Star Topology
77 In LAN commonly used topologies are_____. R 1
A. Mesh and Ring
B. Bus and ring
C. Star
D. both B & C
Answer: D. both B & C
Explanation: LAN commonly used topologies are Mesh and Ring, Bus and ring.
78 FDDI stands for. R 1
A. Fiber Distributed Data Interface
B. Fiber Data Distributed Interface
C. Fiber Dual Distributed Interface
D. Fiber Distributed Data Interface
E. None of these
Answer: D. Fiber Distributed Data Interface
Explanation: FDDI stands for Fiber Distributed Data Interface
79 High speed connectivity providing through_______network. U 1
A. LAN
B. MAN
C. WAN
D. All of these
Answer: B. MAN
Explanation: High speed connectivity providing through MAN
network.
80 Which of these class is used to encapsulate IP address and DNS? R 1
a)DatagramPacket
b)URL
c)InetAddress
d) ContentHandler

Answer: c
Explanation: InetAddress class encapsulate both IP address and DNS, we can interact with this class by using name
of an IP host.
81 What is the output of this program? R 1
1. import java.net.*;
2. class networking {
3. public static void main(String[] args) throws UnknownHostException {
4. InetAddress obj1 = InetAddress.getByName("cisco.com");
5. InetAddress obj2 = InetAddress.getByName("sanfoundary.com");
6. boolean x = obj1.equals(obj2);
7. System.out.print(x);
8. }
9. }
a)0
b)1
c)true
d) false
Answer: d

Explanation: InetAddress obj1 = InetAddress.getByName(“cisco.com”); creates object obj1 having DNS and IP
address of cisco.com, InetAddress obj2 = InetAddress.getByName(“sanfoundry.com”); creates obj2 having DNS
and IP address of sanfoundry.com , since both these address point to two different locations false is returned by
obj1.equals(obj2);.
82 Which of these is a protocol for breaking and sending packets to an address across a network? R 1
a)TCIP/IP
b)DNS
c)Socket
d) Proxy Server

Answer: a
Explanation: TCP/IP – Transfer control protocol/Internet Protocol is used to break data into small packets an send
them to an address across a network.
83 What is the output of this program? U 1
1. import java.io.*;
2. import java.net.*;
3. public class URLDemo {
4. public static void main(String[] args) {
5. try {
6. URL url=new URL("http://www.sanfoundry.com/java-mcq");
7. System.out.println("Protocol: "+url.getProtocol());
8. System.out.println("Host Name: "+url.getHost());
9. System.out.println("Port Number: "+url.getPort());
10. } catch(Exception e){System.out.println(e);}
11. }
12. }
a)Protocol:http
b)HostName:www.sanfoundry.com
c)PortNumber:-1
d) all above mentioned

Answer: d
Explanation:getProtocol() giveprotocol which is http getUrl() give name domain name getPort() Since we have not
explicitly set the port, default value that is -1 is printed.
84 Network programming in any language definitely needs to deal with ____________ and _______________. R 1
A. user names; port numbers
B. IP addresses; link-layer address
C. IP addresses; port numbers
D. None of the choices are correct.
Answer:C. IP addresses; port numbers
Explanation: Network programming in any language definitely needs to deal with Network programming in any
language definitely needs to deal with
85 In Java, an IP address is defined as an object, the instance of _______ class. R 1
A. InetAddress
B. SocketAddress
C. IPAddress
D. None of the choices are correct.
Answer:A. InetAddress
Explanation: an IP address is defined as an object, the instance of Inet address class.
86 In Java, which of the following statement is true? U 1
A. To create IPv4 address we must use Inet4Address class.
B. To create IPv6 address we must use Inet6Address class.
C. We can use InetAddress class to create both IPv4 and IPv6 addresses.
D. None of the choices are correct.
Answer:C. We can use InetAddress class to create both IPv4 and IPv6 addresses.
Explanation: We can use InetAddress class to create both IPv4 and IPv6 addresses.
87 A port number in Java is defined as ________________ integer. U 1
A. a 16-bit integer
B. a 24-bit integer
C. a 48-bit integer
D. None of the choices are correct.
Answer: B. a 24-bit integer
Explanation: A port number in Java is defined as a 24-bit integer

88 The class used in Java network programming for socket address is the ______________ class. U 1
A. InetAddress
B. SocketAddress
C. InetSocketAddress
D. None of the choices are correct.
Answer:C. InetSocketAddress
Explanation: The class used in Java network programming for socket address is the InetSocketAddress
class

89 A server in a client-server paradigm can be designed either as an _______ server or a _________ server. U 1
A. asynchronous; concurrent
B. iterative; concurrent
C. simultaneous; intermittent
D. None of the choices are correct.
Answer:B. iterative; concurrent
Explanation: A server in a client-server paradigm can be designed either as an iterative concurrent.
90 A concurrent server can server ___________. R 1
A. one client at a time
B. only two clients simultaneously
C. several clients simultaneously
D. None of the choices are correct.

Answer: C. several clients simultaneously


Explanation: A concurrent server can server several clients simultaneously.
91 An iterative server handles _________________. R 1
A. one client at a time
B. two clients simultaneously
C. several clients simultaneously
D. None of the choices are correct.

Answer: A. one client at a time


Explanation: An iterative server handles one client at a time.
92 Java implementation of UDP uses ____________________. R 1
A. only one type of socket objects
B. two types of socket objects
C. many types of socket objects
D. None of the choices are correct.

Answer:A. only one type of socket objects


Explanation: Java implementation of UDP uses only one type of socket objects
93 The DagramSocket class is used to create sockets ________________. R 1
A. in the UDP client
B. in the UDP server
C. in both the UDP client and UDP server
D. None of the choices are correct.

Answer:C. in both the UDP client and UDP server


Explanation: The DagramSocket class is used to create sockets . in both the UDP client and UDP server
94 The ________________ class is used to create datagram packets. R 1
A. DatagramPacket
B. DagramSocket
C. DagramSocket or DatagramPacket
D. None of the choices are correct.

Answer:C. DagramSocket or DatagramPacket


Explanation: The DagramSocket or DatagramPacket class is used to create datagram packets.
95 Java implementation of TCP uses _______________ types of socket objects. R 1
A. only one
B. only two
C. Many types
D. None of the choices are correct.
Answer:B. only two
Explanation: Java implementation of TCP uses only two types of socket objects.
96 In Java implementation of TCP, a client uses _________; a server uses __________. R 1
A. ClientSocket object; ServerSocket object
B. Socket object; ServerSocket objec
C. Socket object; ServerSocket object and Socket object
D. None of the choices are correct.
Answer:C. Socket object; ServerSocket object and Socket object
Explanation: Java implementation of TCP, a client uses Socket object.
97 ServerSocket is sometimes called the ________ and or the ______ socket. U 1
A. passive socket; listen socket
B. active socket; listen socket
C. waiting socket; listen socket
D. None of the choices are correct.

Answer:A. passive socket; listen socket


Explanation: ServerSocket is sometimes called the passive socket; listen socket
98 _______________ is responsible for establishing a connection. R 1
A. Socket
B. ServerSocket
C. ClientSocket
D. None of the choices are correct.

Answer: C. ClientSocket
Explanation: ClientSocket is responsible for establishing a connection.
99 In Java two methods, getOutputStream and getInputStream, are provided in the ________ class. A 1
A. ServerSocket
B. Socket
C. Stream
D. None of the choices are correct.
Answer:B. Socket
Explanation: two methods, getOutputStream and getInputStream, are provided in the Socket class.
100 How do you implement reliable transmission in UDP protocol? A 1
(by sequencing packages
a
)
(by using Middleware
b
)
(A & B both
c
)
(None of the above
d
)

Answer: a)
Explanation: implement reliable transmission in UDP protocol by sequencing packages.

You might also like