Write code to search a char in a char array
//package com.book2s; public class Main { public static void main(String[] argv) { int iChr = 42; char[] chr = new char[] { 'b', 'o', 'o', 'k', '2', 's', '.', 'c', 'o', 'm', 'a', '1', }; System.out.println(charMatch(iChr, chr)); }//from w ww .j a v a 2 s .co m private static boolean charMatch(int iChr, char[] chr) { for (int i = 0; i < chr.length; i++) { if (iChr == chr[i]) { return true; } } return false; } }