Implementation basic concepts in java