歡迎使用CSDwaeffead

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class a {

/**
 * @param argsa
 */
public static void main(String[] args) {
    String url = "https://blog.csdn.net/qq_27034631/article/details/49635981";
    for(int i = 0; i < 500; i++)
    {
        for(int j = 0; j < 10000; j++)
        {   
            loadJSON(url);
            //System.out.println("j = "+j);
        }
        System.out.println("i = "+i);
    }
}

public static  String loadJSON(String url) {
    StringBuilder json = new StringBuilder();
    try {
        URL oracle = new URL(url);
        URLConnection yc = oracle.openConnection();
        //BufferedReader in = new BufferedReader(new InputStreamReader(
                //yc.getInputStream(),"utf-8"));//防止亂碼

        //in.close();
            } catch (MalformedURLException e) {
        } catch (IOException e) {
    }
    return "OK";
}

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章