Skip to content

Instantly share code, notes, and snippets.

@mrdaemon
Created February 19, 2011 04:36
Show Gist options
  • Save mrdaemon/834823 to your computer and use it in GitHub Desktop.
Save mrdaemon/834823 to your computer and use it in GitHub Desktop.
public class DicksOnParade {
public static void main(String[] args) {
Dong aDick = new Dong();
String cockname = aDick.getName();
System.out.println("Dick length: " + cockname.length());
}
}
public class Dong {
private String name;
public void setName(String n) {
this.name = n;
}
public String getName() {
return this.name;
}
}
[0:538] callisto:~ $ javac Dong.java
[0:539] callisto:~ $ javac DicksOnParade.java
[0:540] callisto:~ $ java DicksOnParade
Exception in thread "main" java.lang.NullPointerException
at DicksOnParade.main(DicksOnParade.java:7)
[0:541] callisto:~ $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment