AJP ch4 MCQ
AJP ch4 MCQ
a. TCP
b. UDP
c. IP
d. HTTP
3) Which protocol that web browsers and servers use to transfer hypertext pages
and images?
a. TCP/IP
b. UDP
c. HTTP
d. SMTP
6) What is URL?
a. Unicast Resource Location
b. Uniform Research Launcher
c. Universal Research Locator
d. Uniform Resource Locator
7) Which class is used to encapsulate both the numerical IP address and the domain
name for that address?
a. InetAddress
b. SocketAddress
c. IPAdress
d. DNSSockets
8) IP address is a ________ protocol that breaks data into small packets and sends
them to an area across network.
a. low-level routing
b. high-level routing
c. medium-level routing
d. none of the above
9) _____ is a higher level protocol that manages to robustly string together the
packets, sorting and retransmitting them.
a. TCP
b. b.UDP
c. c.none of the above
d. both a & b
10) _______ can be used directly to support fast, connectionless and unreliable
transport of packets.
a. UDP
b. b.TCP
c. c.none of the above
d. d. both a & b
11) Which of the following Instance Method returns a string that represents the host
name associated with the InetAddress object?
a. String getHostAddress()
b. String getByName()
c. String getHostName()
d. String toString()
12) Which of the folowing Instance Method Returns true if this Internet address is a
multicast address. Otherwise, it returns false?
a. boolean equals(Object other)
b. boolean isMulticastAddress()
c. boolean isMultiCastAddress()
d. boolean MulticastAddress()
13) Which of the following Instance Method returns a string that lists the host name and
the IP address for convenience?
a. String getHostAddress()
b. String getByName()
c. String getHostName()
d. String toString()
14) ______ sockets are used to implement reliable, bidirectional, persistent, point-to-
point, stream-based connections between hosts on the Internet.
a. TCP/IP
b. UDP
c. Proxy
d. None of the above
15) _____ can be used to connect Java’s I/O system to other programs that may reside
either on the local machine or on any other machine on the Internet.
a. Server
b. Client
c. Socket
d. All of the above
16) Which class is designed to be a “listener,” which waits for clients to connect before
doing anything?
a. Socket
b. Server
c. Both a & b
d. ServerSocket
17) Which are the two constructors used to create client sockets?
a. Socket(String hostName) ,Socket(InetAddress ipAddress, int port)
b. Socket(String hostName, int port) ,Socket(InetAddress ipAddress)
c. Socket(String hostName, int port), Socket(InetAddress ipAddress, int
port)
d. None of the above
18) By using following methods a socket can be examined at any time for the address
and port information associated with it.
a. InetAddress getInetAddress( )
b. int getPort( )
c. int getLocalPort( )
d. All of the above
19) Which of the following method returns the InetAddress associated with the Socket
object?
a. InetAddress getInetAddress( )
b. int getPort( )
c. int getLocalPort( )
d. All of the above
20) Which of the following method returns the remote port to which this Socket object is
connected?
a. InetAddress getInetAddress( )
b. int getPort( )
c. int getLocalPort( )
d. All of the above
21) When the datagram is received, there is no assurance that it hasn’t been damaged in
trasmissin
a. TRUE
b. FALSE
22) Calling ServerSocket() constructor with port value 'zero' means _____________.
a. use a port number that is automatically allocated.
b. use a local port
c. use server port
d. None of above
23) Which of these package contains classes and interfaces for networking?
a. java.util.*
b. java.networking.*
c. java.net.*
d. java.awt.*
a. single
b. Multiple
c. both a and b
d. none of above
26) A_______ is responsible for determining whether code executing in the Java runtime
environment has permission to perform a security sensitive operation.
a. Permission object
b. security object
c. policy object
d. all of above