I am trying to read a web page content using below code. But it do not print the web content as is expected. There is no error seen on IDE. And there is no exception. Proxy is also not set. Could anyone guide why it might not be working
import java.net.*;
import java.io.*;
public class URLReader {
public static void main(String[] args) throws Exception {
URL oracle = new URL("http://www.oracle.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(oracle.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
}
The control do not go inside while loop as debugged. But in buffer reader obj , there is a java object seen