我目前正在调用以下代码行:
java.net.URL connection_url = new java.net.URL("http://<ip address>:<port>/path");
Run Code Online (Sandbox Code Playgroud)
我执行时得到上面的异常.关于为什么会发生这种情况的任何想法?
你的代码对我来说工作得很好:
public static void main(String[] args) {
try {
java.net.URL connection_url = new java.net.URL("http://:/path");
System.out.println("Instantiated new URL: " + connection_url);
}
catch (MalformedURLException e) {
e.printStackTrace();
}
}
Run Code Online (Sandbox Code Playgroud)
实例化新 URL:http://:/path
确定你有正确的代码行吗?
| 归档时间: |
|
| 查看次数: |
74523 次 |
| 最近记录: |