正确例题
public class E1{
public static void main(String args[]){
String str=“hellojavaworld”;
char[] array=str.toCharArray();//将字符串转化成字符数组
System.out.println(“判断字符a是否在字符串中”);
for(char c:array){
if(c==‘h’){
System.out.println(“字符a在字符串中”);
}
}
}
}