Some basic codes in Java