我试图让它在mac上工作,它在linux上工作得很好。
public class URLTest {
public static void main(String[] args) {
try{
String webpage="Insert random webpage here";
InputStream in = new URL(webpage).openConnection().getInputStream();
InputStreamReader reader = new InputStreamReader(in);
while(reader.ready())
System.out.print((char)reader.read());
}catch (IOException e){
;
}
}
在 Mac 上,我只得到数字作为输出,而在 Windows 上,我什么也得不到。有什么想法可以在所有系统上运行吗?
干杯