compiler-design-eth/javali_tests/from_prev_HW/Arrays.javali
Carlos Galindo 0afc86ceeb
Homework 3
2020-01-15 22:32:25 +01:00

24 lines
No EOL
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);}
}
}