Solved

What Is the Output of This Code Snippet? String Str

Question 33

Multiple Choice

What is the output of this code snippet? String str = "ABCabc";
Char ch;
Int i = 0;
While (i < str.length() )
{
Ch = str.charAt(i) ;
If (Character.isLowerCase(ch) )
{
System.out.print(i + " ") ;
}
Else
{
I++;
}
}


A) 3 4 5
B) 3
C) 3 3 3 3 3 ... (infinite loop)
D) 0 1 2

Correct Answer:

verifed

Verified

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

Related Questions