⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getpage.java

📁 this gives details of the network programming
💻 JAVA
字号:
// Sample Java code - uses URL object to retreive a web page//// Looks for a url on the command line, sends the content of the//   url to stdout.import java.net.*;import java.io.*;public class GetPage {    public static void main(String[] args)    throws IOException, MalformedURLException{	if (args.length!=1) {	    System.out.println("You need to specify a URL");	    System.exit(0);	}	URL u = new URL(args[0]);	//	InputStream in = u.openStream();	BufferedReader r = new BufferedReader(new InputStreamReader ( u.openStream()));	String s;	while (	(s = r.readLine()) != null) {	    System.out.println(s);	}    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -