5 years ago in Java Network Programming

What is the output of this program?

import java.net.*;
class networking {
public static void main(String[] args) throws Exception {
URL obj = new URL("http://www.sanfoundry.com/javamcq");
URLConnection obj1 = obj.openConnection();
int len = obj1.getContentLength();
System.out.print(len);
}
}

[A] 126
[B] 127
[C] Compilation Error
[D] Runtime Error
Loading...
Next Question

Overall Stats

Attempted 135
Correct 19
Incorrect 36
Viewed 80

Answers

Guest
Guest
Vaibhav Bisht
Vaibhav Bisht - 1 month ago

Vaibhav Bisht from Dehradun, India is saying Compilation Error is correct answer

serrafine_ silviya_J_17E238
serrafine_ silviya_J_17E238 - 2 months ago

serrafine_ silviya_J_17E238 is saying Compilation Error is correct answer

sowmiya soundararajan
sowmiya soundararajan - 2 months ago

sowmiya soundararajan is saying Compilation Error is correct answer

Aadarshbalraj Balraj
Aadarshbalraj Balraj - 2 months ago

Aadarshbalraj Balraj is saying Runtime Error is correct answer

Barath Mohan
Barath Mohan - 3 months ago

Barath Mohan is saying Compilation Error is correct answer

Related Questions

Which of these method of httpd class is used to write UrlCacheEntry object into local disk?

  • [A] writeDiskCache()
  • [B] writetoDisk()
  • [C] writeCache()
  • [D] writeDiskEntry()

An analog signal carries 4 bits in each signal unit. If 1000 signal units are sent per second, then baud rate and bit rate of the signal will be respectively.

  • [A] 4000 bauds \ sec & 1000 bps
  • [B] 2000 bauds \ sec & 1000 bps
  • [C] 1000 bauds \ sec & 500 bps
  • [D] 1000 bauds \ sec & 4000 bps

Which of these methods of httpd class is used to read data from the stream?

  • [A] getDta()
  • [B] GetResponse()
  • [C] getStream()
  • [D] getRawRequest()

When data and acknowledgement are sent in the same frame, this technique is called as:

  • [A] Piggy packing
  • [B] Piggy backing
  • [C] Back packing
  • [D] Good packing