Home » JAVA Programming » Networking » Question
  1. What is the output of this program?
    import java.net.*;
    public class networking_
    {
    public static void main(String[] args) throws MalformedURLException
    {
    URL object = new URL("https://www.interviewmania.com/java/programming");
    System.out.print(object.toExternalForm());
    }
    }
    1. https://www.interviewmania.com/java/programming
    2. www.interviewmania.com
    3. interviewmania.com/java/programming
    4. https://www.interviewmania.com
    5. None of these
Correct Option: A

toExternalForm() is used to know the full URL of an URL object.



Your comments will be displayed only after manual approval.