Solved

What Is Wrong with the Following Code

Question 56

Multiple Choice

What is wrong with the following code?
Public static int count(String s)
{
For (int i = 0; i < s.length() ; i++)
{
Int cnt = 0;
If (Character.isDigit(s.charAt(i) ) )
{
Cnt++;
}
}
Return cnt;
}


A) Illegal return type
B) Invalid parameter variable type
C) No return statement
D) Invalid scope of variable used in return statement

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