URL test = null;
String inputLine = null;
BufferedReader in = null;
try {
test = new URL("http://localhost/out.php"); // if connection down
} catch (MalformedURLException e) {
inputLine = "test_synntax";
}
try {
in = new BufferedReader(new InputStreamReader(test.openStream()));
...
如果默认情况下 URL 解析失败,如何为 inputline 分配一个值在示例上下文中不是 wifi/3g 连接 disponible,谢谢大家好日子