Exercise done in java community