How do you manually assign a boolean value to every array positions in just one code line?
Look the code fragment below. I don't wanna manually put a[0]=true;
a[1]=true;
a[2]=false;
...
public class stackArray {
static boolean [] a = new boolean [6];
public static void main(String[] args) {
a[0]=true;
a[1]=true;
a[2]=false;
for(int i=0; i<6; i++){
System.out.println(a[i]);
}
}
}
I'm really looking something similar to
a= {true, true, false, false, false, false};
but unfortunately it doesn't works :(
Can anybody help me? I googled it but I couldn't find this particular case. Thank you in advance!