24 lines
499 B
Text
24 lines
499 B
Text
|
/* testing arrays with primitive types as well as new objects
|
||
|
the if/else statements shows that the array is boolean array is initialized with false
|
||
|
*/
|
||
|
class Main {
|
||
|
void main() {
|
||
|
int [] testArray;
|
||
|
boolean [] boolarray;
|
||
|
|
||
|
boolarray = new boolean [3];
|
||
|
testArray = new int [10];
|
||
|
|
||
|
testArray[5] = 3;
|
||
|
boolarray[1] = true;
|
||
|
|
||
|
if (boolarray[0]){
|
||
|
write(1);}
|
||
|
else{
|
||
|
write(5);}
|
||
|
writeln();
|
||
|
if (boolarray[1]){
|
||
|
write(1);}
|
||
|
|
||
|
}
|
||
|
}
|