Snake in Java