title: unknown host exception
body: <pre><code>try { 
  {
      long startTime = System.currentTimeMillis();
  
          String source="s";
          String source1="s";
          URL google = new URL("http://google.com/"); 
          HttpURLConnection yc =(HttpURLConnection)google.openConnection(); 
          BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream())); 
          String inputLine;
  
  
          while ((inputLine = in.readLine()) != null) { 
              source=source.concat(inputLine);
          }
          in.close();
  
          yc.disconnect();
  
      }
  
  long endTime1 = System.currentTimeMillis();
  System.out.println("Total elapsed time in execution of method callMethod() is :"+ (endTime1-startTime));
  
  
      } 
  }
  </code></pre>
  
  <p>when i tried the above through command prompt
   i got</p>
  
  <pre><code>java.net.UnknownHostException: google.com 
  at java.net.PlainSocketImpl.connect(Unknown Source) 
  at java.net.Socket.connect(Unknown Source) 
  at java.net.Socket.connect(Unknown Source) 
  at sun.net.NetworkClient.doConnect(Unknown Source) 
  at sun.net.www.http.HttpClient.openServer(Unknown Source) 
  at sun.net.www.http.HttpClient.openServer(Unknown Source) 
  at sun.net.www.http.HttpClient.&lt;init&gt;(Unknown Source) 
  at sun.net.www.http.HttpClient.New(Unknown Source) 
  at sun.net.www.http.HttpClient.New(Unknown Source) 
  at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) 
  at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) 
  at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) 
  at ScagntJavaHttp.httpMakeRequest(ScagntJavaHttp.java:185) 
  at test.main(test.java:23)
  </code></pre>
  
  <p>Can any help me in resolving this one?</p>