Monday, July 30, 2012

Java Pitfalls Book


This book "Java™ Puzzlers: Traps, Pitfalls, and Corner Cases" gives insight into some Java "fails" that one needs to watch out for when developing.

It explains what is wrong with this piece of code (It doesn't print out AB as one would expect):

public class PrintingSomeLetters {
  public static void main(String[] args) {
    System.out.println('A' + 'B');
  }
}