public class ex2 { static char[] generateChars (int length) { char[] charArray = new char [length]; for (int i=0; i= 0) System.out.println ("Found at position=" + position); else System.out.println ("Not found"); } catch (Exception e) { e.printStackTrace(); } } }