Java tricks

This is a bag of Java Tricks!

Integer.parseInt
Integer.parseInt (and Long.parseLong) is the basic function to convert from String to numbers.

BigInteger
BigInteger (and BigDecimal) is the built-in library for precise really really big numbers. BigInteger has all the basic functions of arthmetic, as well as "isProbablePrime" and "GCD", which are useful in some cases.

Multi-Dimensional Array Caching
When using multi-dimensional arrays, you can cache the outer arrays to improve performance hit. This is because it would be checked for out of bounds conditions otherwise.