开发者

URL Object is not recognized

I am writing a web service similar to below. But Java is not recognizing the URL, URLConnection. I am unable to solve this issue.

URL yahoo = new URL("htt开发者_开发百科p://www.yahoo.com/");
URLConnection yc = yahoo.openConnection();
int dataLen = yc.getContentLength() ;


This code is Java, not JavaScript. I am guessing that you have not imported the classes from the java.net package.

  • Tutorial on packages
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜