What Will Be The Output Of The Following Java Programp Pre #629
What will be the output of the following Java program?</p> <pre><code class="language-java" line="1"> import java.net.*; class networking { public static void main(String[] args) throws UnknownHostException { InetAddress obj1 = InetAddress.getByName("cisco.com"); System.out.print(obj1.getHostName()); } }</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Serialization Networking - Java Networking Basics - Quiz No.1.
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()); } }
cisco
cisco.com
www.cisco.com
none of the mentioned