I have an arraylist As such :-
products.add( new CarsSubProduct( "FordMustang",1,12,10000 ) );
products.add( new CarsSubProduct( "JEEP",2,10,10000 ) );
I am trying to Edit just the value 12 without altering the value of the other objects but no success.When i use the set method it automatically modifies all the four objects in the arraylist.
I want to implement this technique in an Inventory software where ,when a user buys e.g Ford Mustang the units sold shall be decremented from 1000 which is the total available units in stock.