Skip to main content

Posts

Showing posts from March, 2010

Null Pointer Exception

This is why I don't program in Java: import java.util.ArrayList; class Program { class Person { public Person partner; } class Prostitute extends Person { } class Eunuch extends Person { } private Prostitute prostitute; private Eunuch eunuch; public static void main(String[] args) { Program p = new Program(); p.run(); } public void run() { eunuch.partner = prostitute; } } > Exception in thread "main" java.lang.NullPointerException But if you do, you should check out the nifty online JXXX Compiler Service .