my java code snippet