Examveda

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.

A. 126

B. 127

C. Compilation Error

D. Runtime Error

Answer: Option B


This Question Belongs to Java Program >> Java Serialization And Networking

Join The Discussion

Related Questions on Java Serialization and Networking

What is Java Serialization?

A. The process of converting an object into a byte stream

B. The process of converting a byte stream into an object

C. The process of converting an object into a text file

D. The process of converting a text file into an object