• Post Reply Bookmark Topic Watch Topic
  • New Topic

What's wrong here..

 
Mahajan Bhupendra
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi just now i have started the java.net
and the very first program give me an error
my program is ..

it's giving me error..
computer1/200.200.200.38
Exception in thread "main" java.net.UnknownHostException: www.rediff.com
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at InetAddressTest.main(InetAddressTest.java:7)

i think it is beacause in our office we are having LAN and server is having NT4.0 with service pack 6..
is the problem beacuse of LAN or anything wrong in a program itself..
 
Mahajan Bhupendra
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey one day has passed please give me answer..
 
ping203
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The error message tells you what is wrong.
Exception in thread "main" java.net.UnknownHostException: www.rediff.com.
Your network does not know what "www.rediff.com" is(Unknown host). It is like you type some address and your browser returns you a Page Not Found message.
btw, your code works fine on my machine and I got the output:
www.rediff.com/64.41.191.70
Ping
 
Mahajan Bhupendra
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we use internet frequently as we have a common connection to server and wingate(software that distributes internet to LAN clients)...
so if i type rediff.com in by browser i didn't get any error but the web site...
what should be the problem???
 
Laudney Ren
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just wondering, if main() can throw any exception. Maybe you can't change the signature. It is and always should be: public static void main(String args[])
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!