Home » JAVA Programming » Networking » Question
  1. What is the output of this program?
    import java.net.*;
    public class networking_Example
    {
    public static void main(String[] args) throws UnknownHostException
    {
    InetAddress object = InetAddress.getByName("interviewmania.com");
    System.out.print(object.getHostName());
    }
    }
    1. Compile time error
    2. Runtime error
    3. Interviewmania
    4. interviewmania.com
    5. None of these
Correct Option: D

interviewmania.com



Your comments will be displayed only after manual approval.