How do you manually assign variables to an array? I have a code fragment below.
I don't want to manually put shortStraight[0] = "211100", shortStraight[1] = "021110"
, and so on. Any help?
private String [] shortStraight;
public Sample () {
shorty = new String [12];
shorty = {211100, 021110, 002111, 121100, 112100, 111200, 012110, 011210, 011120, 001211, 001121, 001112 } //this line doesn't work.
Any help?
String[] shorty = {"211100", "021110", "002111", "121100", "112100", "111200", "012110", "011210", "011120", "001211", "001121", "001112"} ;
String[] shorty = {"211100", "021110", "002111", "121100", "112100", "111200", "012110", "011210", "011120", "001211", "001121", "001112"} ;
http://download.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With