I wrote a method but if blocks don't work, result is =0 male 0 female.
How can ı fix it?
public static void genderCount(String arr[][]){ int maleCounter=0; int femaleCounter=0; for(int i =0;i<arr.length;i++){ for(int j =0;j<arr[i].length;j++){ if(j==1){ if(arr[i][j]=="m" || arr[i][j]=="M" ){ maleCounter++; } else if(arr[i][j]=="F" || arr[i][j]=="f" ){ femaleCounter++; } } } } System.out.println(maleCounter+" male "+femaleCounter+" female"); }