我有以下 java 函数来检查网站响应代码:
URL u = null;   
try {
    u = new URL("http://bforball.com");
    HttpURLConnection huc =  ( HttpURLConnection ) u.openConnection (); 
    huc.setRequestMethod ("GET"); 
    huc.connect () ; 
}
我已经导入了以下内容:
import java.net.HttpURLConnection;
但是当我编译我的代码时,我在附近收到警告消息
u.openConnection
警告信息:
Connot find the symbol
Symbol: mehod openConnection()
Location:variable u of type URL
我做错了什么?