Some basic java codes