add java file for magic square