What will be the output of the following Java program?

import java.net.*;
   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) none of the mentioned

1 thought on “What will be the output of the following Java program?”

Leave a Comment