title: Error in HttpURLConnection - openConnection
body: <p>I am having the following java function for check the website responce code:</p>
  
  <pre><code>URL u = null;   
  
  try {
      u = new URL("http://bforball.com");
      HttpURLConnection huc =  ( HttpURLConnection ) u.openConnection (); 
      huc.setRequestMethod ("GET"); 
      huc.connect () ; 
  }
  </code></pre>
  
  <p>I have imported the below:</p>
  
  <pre><code>import java.net.HttpURLConnection;
  </code></pre>
  
  <p>But when I compile my code I am getting warning message near </p>
  
  <blockquote>
    <p>u.openConnection</p>
  </blockquote>
  
  <p>Warning message:</p>
  
  <pre><code>Connot find the symbol
  Symbol: mehod openConnection()
  Location:variable u of type URL
  </code></pre>
  
  <p>What I am doing wrong?</p>