Simple Program written in java