Skip to main content

Posts

Showing posts with the label Java

I Remember...

I remember when Java first came out surfing the Internet on my 28k dial-up connection and hitting a page with a Java applet ; either Netscape would come crashing down or my computer would lock up... I remember schoolmates telling me Java was "the future" because it ran on a virtual machine which meant it was cross platform, and then being ostracized by them when I pointed out that QBasic would be considered cross platform , too... I remember reading Java programming books before I understood OOP and wondering why I had to write a hundred lines of code just to output "Hello World" ... I remember reading Java programming books after I understood OOP and still wondering why I had to write a hundred lines of code just to output "Hello World"... I remember trying to convince myself every time I started Eclipse and watched my P4 run slower than a 486 that I just hadn't given Java a fair shake and I needed to embrace it with an open heart and mind....

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 .