61.
What will be the output of the following Java program?
import java.net.*;
class networking 
{
    public static void main(String[] args) throws Exception 
    {
        URL obj = new URL("https://www.example.com/javamcq");
        URLConnection obj1 = obj.openConnection();
        int len = obj1.getContentLength();
        System.out.print(len);
    }
}

Note: Host URL is having length of content 127.

65.
What will be the output of the following Java program?
import java.net.*;
class networking
{
    public static void main(String[] args) throws MalformedURLException 
    {
        URL obj = new URL("https://www.example.com/javamcq");
        System.out.print(obj.getHost());
    }
}

68.
What will be the output of the following Java program?
import java.net.*;
class networking 
{
    public static void main(String[] args) throws MalformedURLException 
    {
        URL obj = new URL("https://www.example.com/javamcq");
        System.out.print(obj.toExternalForm());
    }
}

Read More Section(Java Serialization and Networking)

Each Section contains maximum 100 MCQs question on Java Serialization and Networking. To get more questions visit other sections.