![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
本题统计字符串str中字母a出现的次数,其中str为“(7&asdfasdf873eat687al(4a”,字母a存储
本题统计字符串str中字母a出现的次数,其中str为“(7&asdfasdf873eat687al(4a”,字母a存储在字符变量c中,最后打印输出结果。
public class javal{
public static void main(String[]args){
String str="(*&7asdf adf873eat687al(4a";
char c;
int sum=0;
int i=0:
do{
c= ;
if()
sum++:
i++:
}while();
System.out.println("sum="+sum);
}
}
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)