some java code for practice