Networking


  1. Which class represents an Internet Protocol address?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    InetAddress represents an Internet Protocol address. It provides static methods like getByAddress(), getByName() and other instance methods like getHostName(), getHostAddress(), getLocalHost().


  1. What does local IP address start with?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Local IP addresses look like 10.X.X.X, 172.X.X.X, or 192.168.X.X.



  1. What happens if IP Address of host cannot be determined?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    UnknownHostException is thrown when IP Address of host cannot be determined. It is an extension of IOException.


  1. What is the output of this program?
     import java.lang.reflect.*;
    public class Additional_packages_Example
    {
    public static void main(String args[])
    {
    try
    {
    Class obj = Class.forName("java.awt.Dimension");
    Field fields[] = obj.getFields();
    for (int k = 0; k < fields.length; k++)
    System.out.println(fields[k]);
    }
    catch (Exception e)
    {
    System.out.print("Exception");
    }
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Program prints all the data members of ‘java.awt.Dimension’ package



  1. Which of the following is used for session migration?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Session migration is done by persisting session in database. It can also be done by storing session in memory on multiple servers.