Solved

How Many Times Does the Following Loop Execute

Question 37

Multiple Choice

How many times does the following loop execute?
Int upperCaseLetters = 0;
String str = "abcdEfghI";
Boolean found = false;
For (int i = 0; i < str.length() && !found; i++)
{
Char ch = str.charAt(i) ;
If (Character.isUpperCase(ch) )
{
Found = true;
}
}


A) 9 times
B) 8 times
C) 5 times
D) 1 time

Correct Answer:

verifed

Verified

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

Related Questions