Here my code
public static String modele;
public static String supplier;
public static int height = 180;
public static final String[] COLORS = { "RED", "BLUE", "GOLD",
"ORANGE", "PURPLE", "PINK", "NONE" };
public static String description;
public static boolean withSnow = false;
public static boolean sale = false;
public static int numIdentification;
//constructor
public Tree (String modele, String supplier, String description, int height, int typeColors, boolean sale, boolean withSnow){
//////////////////////////////////////
// a completer selon les directives //
//////////////////////////////////////
this.modele = modele;
this.supplier = fournisseur;
this.description = description;
this.height = hauteur;
this.sale = sale;
this.withSnow = withSnow;
numIdentification = numIdentification + 1;
}
Here my question
when i created my Tree with this constructor
let say i created my object i pass those values
Tree("tree1","supplier1","firstDescrip",190,2,true,true);
the variable typeColors in my constructor i assign number 2
how i determined that 2 = "BLUE" in my array name COLORS when i create the object.
I want to call it with a function Tree.getColors to get the value.
I just can't figured out how.... any help would be appreciated.
Sorry if my english its not good.