title: Checking the status of a web page
body: <p>Need to make a program that takes a valid URL of a webpage like www.stackoverflow.com/questions and its IP address equivalent. The program will then find that webpage and return the status code of the page to us such as 200 OK and 404 NOT FOUND. If the webpage isn’t reachable, a message should be returned explaining the situation.</p>
  
  <p>Here’s what I have done so far:</p>
  
  <pre><code>interface Result {
    public boolean ok ();
    public String message (); }
  
  class Page {
    public Result check ( String wholeURL ) throws Exception {
       throw new Exception ( "Not sure about the rest”); } }
  </code></pre>
  
  <p>Also if I were to check a page like <a href="http://www.stackoverflow.com">http://www.stackoverflow.com</a> I’ll create an instance of Page and then do something like this: </p>
  
  <pre><code>Page page = new PageImplementation ();
  Result result = page.check ( "http://www.stackoverflow.com:60" );
  if ( result.ok () ) { ... }
  else { ... }
  </code></pre>
  
  <p>The object that is returned is an instance of Result, and the “ok” method should return true when the status code is 200 OK but false otherwise. The method “msg” should return the status code as string.</p>