Solved

What Does the Method Below Return

Question 41

Multiple Choice

What does the method below return?
Int findSomething (String str)
{
Int position = 0;
While (position < str.length() &&
(str.charAt (position) != 'e') )
{
Position++;
}
Return position;
}


A) The position of the first 'e' in the string or the length of the string if there is no 'e'
B) The position of the last 'e' in the string or the length of the string if there is no 'e'
C) The position of the first character that is not an 'e' in the string or the length of the string if there is no character that is not an 'e'
D) The position of the last character that is not an 'e' in the string or the length of the string if there is no character that is not an 'e'

Correct Answer:

verifed

Verified

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

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents