Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.net.UnknownHostException: www.google.com

559733Mar 17 2009 — edited May 5 2010
Dear Experts,
my Coding
       URL u = new URL("http://www.google.com");
/*            URL u = new URL(url1);  */
            InputStream in = u.openStream();
           in = new BufferedInputStream(in);
          Reader r = new InputStreamReader(in);
          int c;
         
while ((c =r.read())!=-1)
{
System.out.print((char)c);
}
I get an error as java.net.UnknownHostException: www.google.com
Please Suggest an solution...
Advance Thanks,
Rengaraj.R
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2010
Added on Mar 17 2009
6 comments
2,733 views