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
精彩评论