We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 71201a7 commit e41cc71Copy full SHA for e41cc71
Fetch.java
@@ -0,0 +1,16 @@
1
+import java.net.URLConnection;
2
+import java.util.Scanner;
3
+import java.net.URL;
4
+
5
+class Fetch {
6
+ public static void main(String [] args) throws Exception {
7
+ String content = null;
8
+ URLConnection connection = null;
9
+ connection = new URL("http://www.google.com").openConnection();
10
+ Scanner scanner = new Scanner(connection.getInputStream());
11
+ scanner.useDelimiter("\\Z");
12
+ content = scanner.next();
13
+ scanner.close();
14
+ System.out.print(content);
15
+ }
16
+}
0 commit comments