Which of the following are possible data types for friends that would allow the code to compile?
for(var friend in friends)
System.out_println(friend);
A Collection
[ int)
c String
[ Map
E Set
F None of these
G StringBuilder
,What is the output of the following code snippet?
double iguana = 0;
2 do {
int snake = 1;
n System.out.print(snake++ + " ")
iguana--;
6 ) while (snake <= 5);
7 System.out.println(iguana);
A 012345-50
[ 12345-40
c 1234-50
D 1234-40
E None of these
F The code compiles but produces an infinite loop at runtime.
G The code does not compile.
, What is the output of calling printLocation(Animal. MAMMAL)?
1 class Zoo {
2 enum Animal {BIRD, FISH, MAMMAL}
3 void printLocation(Animal a) {
2 long type = switch(a) {
5 case BIRD -> 1;
3 case FISH -> 2;
7 case MAMMAL -> 3;
8 default -> 4;
9 ¥
ho System.out_print (type);
11
A The code does not compile because of line 13.
[ 34
c 4
D 3
3 None of these
F The code does not compile because of line 17.
for(var friend in friends)
System.out_println(friend);
A Collection
[ int)
c String
[ Map
E Set
F None of these
G StringBuilder
,What is the output of the following code snippet?
double iguana = 0;
2 do {
int snake = 1;
n System.out.print(snake++ + " ")
iguana--;
6 ) while (snake <= 5);
7 System.out.println(iguana);
A 012345-50
[ 12345-40
c 1234-50
D 1234-40
E None of these
F The code compiles but produces an infinite loop at runtime.
G The code does not compile.
, What is the output of calling printLocation(Animal. MAMMAL)?
1 class Zoo {
2 enum Animal {BIRD, FISH, MAMMAL}
3 void printLocation(Animal a) {
2 long type = switch(a) {
5 case BIRD -> 1;
3 case FISH -> 2;
7 case MAMMAL -> 3;
8 default -> 4;
9 ¥
ho System.out_print (type);
11
A The code does not compile because of line 13.
[ 34
c 4
D 3
3 None of these
F The code does not compile because of line 17.