wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MindSpace - Networking

Total questions: 15

Worksheet time: 10mins

Name
Class
Date
1.

Which of this package contains classes and interfaces for networking?

a)

java.io

b)

java.util

c)

Java.net

d)

java.network

2.

How many bits are in a single IP address?

a)

8

b)

16

c)

4

d)

32 OR 128

e)

64

3.

Which of these class is used to encapsulate IP Address and Domain Name (Host Name)?

a)

DatagramPacket

b)

URL

c)

InetAddress

d)

URLConnection

4.

InetAddress class object represents ________ and _________ .

a)

MAC Address

b)

IP Address

c)

Host (Domain) Name

d)

URL Address

5.

What is the output of this program?

class networking

{

public static void main(String[] args)

throws UnknownHostException

{

InetAddress ob1 = InetAddress.getByName("sanfoundary.com");

InetAddress ob2 = InetAddress.getByName("sanfoundary.com");

boolean x = ob1.equals(ob2);

System.out.print(x);

}

}

(a)  

6.

What is the output of this program?

class networking

{

public static void main(String[] args)

throws UnknownHostException

{

InetAddress obj1 = InetAddress.getByName("cisco.com");

System.out.print(obj1.getHostName());

}

}

a)

cisco

b)

cisco.com

c)

www.cisco.com

d)

All of the given

7.

InetAddress class has constructors.

a)

True

b)

False

8.

IPv4 and IPv6 IP Addresses has size of:

a)

4 bytes and 60 bytes

b)

4 bytes and 6 bytes

c)

4 bytes and 1128 bytes

d)

4 bytes and 16 bytes

9.

InetAddress factory methods throws which exception?

a)

Exception

b)

UnkonwnException

c)

HostException

d)

UnkonwnHostException

10.

Which method return the InetAddress of our local host?

a)

getLocalHost( )

b)

getLocalHost(String hostName )

c)

getByLocalHost( )

d)

getByname(String hostName )

11.

Which factory method is used to return InetAddress of host whose name is specified?

a)

getByName( )

b)

getByName(String hostName )

c)

getLocalHost( )

d)

getByName(byte IPAddr[ ])

12.

Which method is used to get ALL InetAddress of given host?

a)

getLocalHost( )

b)

getByName(String hostName)

c)

getAllByName(String hostName)

d)

getByAddress(byte IPAddr[ ])

13.

Which methods return the InetAddress for the specified IP Address?

a)

getLocalHost( )

b)

getByName(String hostName)

c)

getByAddress( )

d)

getByAddress(byte IPAddr[])

14.

All the factory methods in InetAddress class are static.

a)

True

b)

False

15.

What is full form of net in java.net package?

(a)