I would use the BigInteger type,
public static void main(String[] args) {
BigInteger n = BigInteger.ONE;
BigInteger p = BigInteger.ONE;
for(int i = 1;i <= 64;i++){
n = n.add(n);
p = p.add(n);
}
System.out.println(p);
}
Output is
36893488147419103231
Edit Based on your comment, you really wanted something more like The Legend of the Chessboard -
BigInteger n = BigInteger.ONE;
BigInteger p = BigInteger.ZERO;
BigInteger TWO = new BigInteger("2");
for (int i = 1; i <= 64; i++) {
StringBuilder sb = new StringBuilder();
sb.append("For square #: " + i);
sb.append(", Grains on square: " + n);
p = p.add(n);
n = n.multiply(TWO);
sb.append(", Running Total: " + p);
System.out.println(sb.toString());
}