T
Tim
Hello all,
I'd appreciate it if anyone could tell me what's wrong with the
following piece of code and how to fix it. I get an "Identifier
expected" compilere error at line 5 (array = new boolean array[20]
public class IntegerSet {
boolean[] array;
array = new boolean array[20];
IntegerSet() {
for(int i = 0; i < array.length; i++) {
array = false;
}
}
public static void main(String[] arg) {
System.out.println( "Values of the array: [ ");
for (int i = 0; i < array.length; i++) {
System.out.println(array + " " + "]");
}
}
}
Thank u in advance.
I'd appreciate it if anyone could tell me what's wrong with the
following piece of code and how to fix it. I get an "Identifier
expected" compilere error at line 5 (array = new boolean array[20]
public class IntegerSet {
boolean[] array;
array = new boolean array[20];
IntegerSet() {
for(int i = 0; i < array.length; i++) {
array = false;
}
}
public static void main(String[] arg) {
System.out.println( "Values of the array: [ ");
for (int i = 0; i < array.length; i++) {
System.out.println(array + " " + "]");
}
}
}
Thank u in advance.