URLConnection

 avatar
Rohit143
java
3 years ago
412 B
18
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...