Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What's wrong here..

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey one day has passed please give me answer..
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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[])
 
Those are the largest trousers in the world! Especially when next to this ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic