javascript - Syntax error in ArrayList -


i trying add element arraylist of class 'pallet'. here did:

arraylist<pallet> pallets = new arraylist<pallet>();     pallets.add(pallet lightsabers = new pallet(cargotype.light_sabers)); 

however, syntax error on both parentheses surrounding pallet lightsabers = .... _sabers) part. 1 left parenthesis

syntax error on token "(", . expected" , 1 right "syntax error on token ")", delete token

i not know went wrong , hope guys can me.

just this

pallets.add(new pallet(cargotype.light_sabers)); 

if want lightsabers variable(it doesn't need one), can this

pallet lightsabers = new pallet(cargotype.light_sabers); pallets.add(lightsabers); 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -