Java examples for Language Basics:char
Compare Two char Arrays
import java.util.Arrays; public class Main { public static void main(String[] args) { char[] charArray1 = new char[]{'d','h','r','q'}; char[] charArray2 = new char[]{'d','a','w','f'}; /*from w ww. ja v a 2s . c om*/ boolean blnResult = Arrays.equals(charArray1,charArray2); System.out.println("Are two char arrays equal ? : " + blnResult); } }