Started by
Otakuholic
on
Topic category: User side tutorials
i keep getting errors but i dont really understand the problem(mostly with the print):
public class Quirks {
List quirks = new ArrayList("One for all", "Explosion", "Dark shadow", "Half hot half cold", "Eraser", "All for one", "Engine", "Decay", "Zero gravity", "Frog", "Giantifcation", "Eletrifacation", "Sugar rush", "Hardening", "Navel laser", "Sticky balls", "Acid", "Vine", "Copy");
String quirk = obj.getRandomElement(quirks);
System.out.println("Your quirk is " + quirk );
still getting closer
Import java;util.Random
List quirks = new ArrayList<String (Arrays.asList("One for all", "Explosion", "Dark shadow", "Half hot half cold", "Eraser", "All for one", "Engine", "Decay", "Zero gravity", "Frog", "Giantifcation", "Eletrifacation", "Sugar rush", "Hardening", "Navel laser", "Sticky balls", "Acid", "Vine", "Copy"));
Random rand = new Random();
int randIndex = rand.nextInt(quirks.length);
System.out.println(quirks[randIndex]);
}
}
maybe
What exactly do you want your code to do???
Also put it under help next time.
If you don't want help fine.