Skip to content

Instantly share code, notes, and snippets.

Created Feb 17, 2012
What would you like to do?
package you;
import clowns.Clown;
import clowns.Volkswagen;
public class You {
private static class BandOfClowns extends Clown {
final int id;
final Volkswagen vw;
public BandOfClowns(int id, Volkswagen vw) {
System.out.println("One more clown, I'm #" + id); = id;
this.vw = vw;
public int hashCode() {
if (id != 1) {
vw.add(new BandOfClowns(id - 1, vw));
return super.hashCode();
public static void main(String args[]) {
Volkswagen vw = new Volkswagen();
vw.add(new BandOfClowns(20, vw));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment