This is why I don't program in Java:
But if you do, you should check out the nifty online JXXX Compiler Service.
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.
So you don't program in Java because it throws a NullPointerException, correctly, when trying to use a null object reference?
ReplyDeletePerhaps I should have written "this is why I'm not *allowed* to write Java." I can't resist the temptation writing joke code like that (eunich couldn't meet up with the prostitute because of a null pointer) to amuse myself, especially when there's the misconception that there are not pointers in Java. Sophomoric humor? Sure. But we all have our downfalls.
ReplyDeleteTim thinks installing the jdk is like giving your system a lobotomy =D
ReplyDeleteYeah I actually totally ignored the whole "concept" you had in there and just looked at the code as code ;)
ReplyDelete