URLConnection
Rohit143
java
4 years ago
412 B
19
Indexable
import java.net.*;
import java.io.*;
public class urlconnection {
public static void main(String[] args) throws Exception {
URL url = new URL("https://www.google.com");
URLConnection con =url.openConnection();
InputStream stream = con.getInputStream();
int i;
while ((i=stream.read())!=-1) {
System.out.print((char)i);
}
}
}
Editor is loading...