Developer Job Interview Questions

Many of these are taken from this page.

What is NullPointerException and how to handle it?
When an object is not initialized, the default value is null. When the following things happen, the NullPointerException is thrown: The NullPointerException is a runtime exception. The best practice is to catch such exception even if it is not required by language design.
 * Calling the instance method of a null object.
 * Accessing or modifying the field of a null object.
 * Taking the length of a null as if it were an array.
 * Accessing or modifying the slots of null as if it were an array.
 * Throwing null as if it were a Throwable value.

What's the difference between J2SDK 1.5 and J2SDK 5.0?
There's no difference, Sun Microsystems just re-branded this version.

How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.