a simple problem in java