import java.net.*; import java.io.IOException; public class getURLConnection { public static void main(String args[]) { URL url; URLConnection ucon; try { url = new URL("http://www.roseindia.net"); try { ucon = url.openConnection(); System.out.println(ucon); } catch (IOException exp) { System.err.println(exp); } } catch (MalformedURLException exp) { System.err.println(exp); } } }