• Post Reply Bookmark Topic Watch Topic
  • New Topic

URL class not working pls help me  RSS feed

kannagiri rosei
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i am using URL class to connect website url and copy the index.html

to C;//test//abcd.html

Error is:
Opening connection to www.ibm.com.../index.html
java.net.UnknownHostException: www.ibm.com

my code is here

URL url = new URL("http://www.ibm.com/index.html");

System.out.println("Opening connection to " + url.getHost() + "..."+url.getFile());

URLConnection urlC = url.openConnection();

am not able to connect the URL?

2.please help how to find ipaddress(web sites) to update in my host file
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!