<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
Input was Mostwanted50
And need output as
Digits-2
Alpha-10
<Below this line, add a link to the EXACT exercise that you are stuck at.>
public class Main{
public static void main(String args[]){
String str="Mostwanted50";
String p="Digits=";
String q="Alphabets=";
String r="";
String u="";
int len=str.length();
int i,x=0,y=0;
for(i=0;i<len;i++){
char ch=str.charAt(i);//getting Character from string
if((ch>='A' && ch<='Z')||( ch>='a' && ch<='z'));
{
x=x+1;
}
if(ch>='1' && ch<='0'){
y=y+1;
}
}
r=q+x;
u=p+y;
System.out.println(r);
System.out.println(u);
}
}
<In what way does your code behave incorrectly? Include ALL error messages.>