Solved

What Is the Value of the Count Variable After the Execution

Question 78

Multiple Choice

What is the value of the count variable after the execution of the given code snippet? ArrayList<Integer> num = new ArrayList<Integer>() ;
Num) add(1) ;
Num) add(2) ;
Num) add(1) ;
Int count = 0;
For (int i = 0; i < num.size() ; i++)
{
If (num.get(i) % 2 == 0)
{
Count++;
}
}


A) 1
B) 2
C) 0
D) 3

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions