//This is a sample program which shows how to input(read) characters from //console. As you can see that it uses class InputStreamReader which is from //package java.io.*. It then creates an object of this class. The parameter //System.in in the constructor signifies that this object will read characters //from keyboard. The nonstatic method read() reads one character from console //and returns its unicode. Please go through the code and understand it. //For inputing integers or other primitive types, see the file //Interactive_reading_integers.java import java.io.*; class Console_chareader { public static void main(String args[]) throws IOException, FileNotFoundException { InputStreamReader inp = new InputStreamReader(System.in); char[] A = new char[40]; int count=0; System.out.println("Input a sequence of at most 100 characters :"); System.out.println("Press q to quit"); int n = inp.read(); char ch; ch = (char)n; while(ch != 'q' && count<40) { A[count] = ch; count = count+1; n = inp.read(); ch = (char) n; } System.out.println("The sequence of characters you entered is : "); for(int j = 0; j