Different Types of Programmers
Monday, November 17, 2008 4:20:54 PM
Different types of programmersVia http://curtis.lassam.net/comics/programmers.png
Reddit thread: Different Types of Programmers
By Behrang Saeedzadeh (the 5th incarnation)
Monday, November 17, 2008 4:20:54 PM
Different types of programmersSaturday, November 1, 2008 6:30:38 AM
What will this program print in the console when you run it?
public class Main { public static void main(String[] args) { A a = new A(); B b = null; try { b = new B(a); } catch (Exception e) {} System.out.println(a.b); System.out.println(b); System.out.println(a.b == b); } } class A { B b; void setB(B b) { this.b = b; System.out.println(this.b); } public String toString() { return b.toString(); } } class B { public B(A a) { a.setB(this); throw new RuntimeException(); } public String toString() { return "B"; } }
anonymous
anonymous
anonymous
anonymous
anonymous