package com.imooc;
import java.util.Arrays;
/**
* Created by Administrator on 2017/3/11.
*/
public class HelloWorld {
public static void main(String[] args) {
String s = "aljlkdsflkjsadjfklhasdkjlflkajdflwoiudsafhaasdasd";
int num = 0;
String [] A = s.split("");
//循环遍历每个字符,判断是否是字符a,如果是累加次数
System.out.println(Arrays.toString(A));
System.out.println(A[0]);
for (int i = 0; i <s.length() ; i++) {
if (A[i].equals("a") ){
num++;
System.out.println("if 语句执行了");
}
else {
System.out.println("你的想法错了....");
}
}
System.out.println(num);
}
}