arraylist - How to create a mutable array list containing immutable objects, Java -


i have objects representing columns in table want declare final. of these columns represent primary keys in table, , columns want add them array list gets passed function.

how can declare mutable list (one can add primary key columns to) contains immutable objects (the column objects themselves)?

public final class column {  private final integer a; private final string  b;  public column(integer a, string b) {     this.a = a;     this.b = b; }  public integer geta() {     return a; }  public string getb() {     return b; }  } 

create column class in fashion , add object arraylist. check out : http://docs.oracle.com/javase/tutorial/essential/concurrency/imstrat.html


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -