Font size
WorksheetsMindSpace - Networking
Total questions: 15
Worksheet time: 10mins
Which of this package contains classes and interfaces for networking?
java.io
java.util
Java.net
java.network
How many bits are in a single IP address?
8
16
4
32 OR 128
64
Which of these class is used to encapsulate IP Address and Domain Name (Host Name)?
DatagramPacket
URL
InetAddress
URLConnection
InetAddress class object represents ________ and _________ .
MAC Address
IP Address
Host (Domain) Name
URL Address
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)
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());
}
}
cisco
cisco.com
www.cisco.com
All of the given
InetAddress class has constructors.
True
False
IPv4 and IPv6 IP Addresses has size of:
4 bytes and 60 bytes
4 bytes and 6 bytes
4 bytes and 1128 bytes
4 bytes and 16 bytes
InetAddress factory methods throws which exception?
Exception
UnkonwnException
HostException
UnkonwnHostException
Which method return the InetAddress of our local host?
getLocalHost( )
getLocalHost(String hostName )
getByLocalHost( )
getByname(String hostName )
Which factory method is used to return InetAddress of host whose name is specified?
getByName( )
getByName(String hostName )
getLocalHost( )
getByName(byte IPAddr[ ])
Which method is used to get ALL InetAddress of given host?
getLocalHost( )
getByName(String hostName)
getAllByName(String hostName)
getByAddress(byte IPAddr[ ])
Which methods return the InetAddress for the specified IP Address?
getLocalHost( )
getByName(String hostName)
getByAddress( )
getByAddress(byte IPAddr[])
All the factory methods in InetAddress class are static.
True
False
What is full form of net in java.net package?
(a)
