做wget的最短Java程序

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了做wget的最短Java程序相关的知识,希望对你有一定的参考价值。

  1. import java.io.*;
  2. import java.net.*;
  3.  
  4. public class wget {
  5. public static void main(String[] args) throws Exception {
  6. String s;
  7. BufferedReader r = new BufferedReader(new InputStreamReader(new URL(args[0]).openStream()));
  8. while ((s = r.readLine()) != null) {
  9. System.out.println(s);
  10. }
  11. }
  12. }

以上是关于做wget的最短Java程序的主要内容,如果未能解决你的问题,请参考以下文章