none of u answer my question except Roy Ben Ami the array method is which actually works.thanks(why it didnt strike to ) now this is for people who suggested using wrapper classes i think they are immutable and hence of no use. i know about the suff of pass by value & pass by reference. so those of u think it can be done by wrapper classes please give me an example(which i think is not possible ) p.s. cindy and eric u have missed my point and explained something else sorry any other clean method except array one? i think java can do better than that.