CVGalleryGamesPreviewRandomJavaSiteWeb
Site updates - 15/04/2005
  • Updated CSS Preview
  • Shiny new look
  • New Alternate styles coming soon!
9/5/2005 - fixed del.icio.us link

Null pointer exception

You have tried to access an object that has had it's pointer declared, but hasn't yet been created.

public class TestException
{

static String bob;

  public static void main(String[] args)
  {
   bib(); if access was here, there would be a not initialised error
  }

  private static void bib()
  {
   if(bob.equals("pie")) bob doesn't have a String yet - gives null pointer exception
   System.out.println("Bob is pie!");
  }


}
NOTE: The Java section is mostly in maintenence mode. I don't have time to work on it right now. Errors will be corrected if pointed out, but they are not actively being searched for. Newer site features, like alternate stylesheets, may cause problems with these pages.