0% found this document useful (0 votes)
36 views6 pages

AJP ch4 MCQ

Advance Java programming MCQ for practice
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)
36 views6 pages

AJP ch4 MCQ

Advance Java programming MCQ for practice
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/ 6

1) Which is the connectionless protocol?

a. TCP

b. UDP
c. IP
d. HTTP

2) What is the port number of HTTP?


a. 80
b. 23
c. 47
d. 92

3) Which protocol that web browsers and servers use to transfer hypertext pages
and images?

a. TCP/IP
b. UDP

c. HTTP
d. SMTP

4) Originally, all Internet addresses consisted of ____ bit values.


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

5) What is the full form of DNS?


a. Domain Naming System
b. Domain Naming Service
c. Domain Naming Software
d. Domain Naming Security

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.*

24) A ServerSocket can connect to ________ clients.

a. single
b. Multiple
c. both a and b
d. none of above

25) A socket identifies __________ in network.


a. communication end point

b. communication start point


c. Intermediate nodes
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

27) Connection oriented communication is possible using ________________classes of


Java.
a. Socket and ServerSocket
b. only Socket
c. only ServerSocket
d. DatagramPacket

28) byte[] getData() method of DatagramPacket class returns __________________

a. Integer array of data contained in datagram


b. array of data contained in datagram
c. String array of data contained in datagram
d. Byte array of data contained in datagram

29) In UDP send() and receive() methods belong to which class?


a. DatagramSocket
b. DatagramPacket
c. Socket
d. ServerSocket

30) Java.net package include following classes.


a. URLConnection
b. Socket
c. InetAddress
d. All of above

You might also like