Here you can find the source of difference2D(char[][] first, char[][] second)
public static int difference2D(char[][] first, char[][] second)
//package com.java2s; //License from project: Open Source License public class Main { public static int difference2D(char[][] first, char[][] second) { int result = 0; for (int i = 0; i < first.length; i++) { for (int j = 0; j < first[0].length; j++) { if (first[i][j] != second[i][j]) { result++;/*from w ww . j a va2s .c om*/ } } } return result; } }