URL connection test - compilation error
<p>I am new to Java, have searched on the net and this forum but unable to figure out why my code is not compiling? Any help will be highly appreciated.</p>

<pre><code>//filename is TestHTTPConnection.java

class TestHTTPConnection {

public static void main (String[] args){

    String strUrl = "http://abc.com";

    try {
        URL url = new URL(strUrl);
        URLConnection Conn = url.openConnection();
        Conn.connect();

        assertEquals(URLConnection.HTTP_OK, Conn.getResponseCode());
    } catch (IOException e) {
        System.err.println("Error creating HTTP connection");
        e.printStackTrace();
        throw e;
    }
}
}
</code></pre>

<p>Compilation error - complains about "URL", "URLConnection" and "IOException".</p>
