开发者

URL Object is not recognized

开发者 https://www.devze.com 2023-01-19 23:23 出处:网络
I am writing a web service similar to below. But Java is not recognizing the URL, URLConnection. I am unable to solve this issue.

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

精彩评论

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