basic stuffs in java ( implementation code )