title: Java-Buffered Reader, How do you read a line using br.readLine(System.in) and convert it to char?
body: <p>I have to do a cryptography program in Java which takes a number and a string(as an instance variable) from the user and adds that number to the ASCII of each letter in the string to create a new String.For example, if the number is 2 and the original string is "ABCXYZ" it should print "CDEZAB"
  This is what I've got so far:</p>
  
  <pre><code>import java.io.*;
  
  public class Program12 {
  
     String str;
  
     public void encodeDecode() throws IOException
  
     {
  
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  
        System.out.println("Input a string");
  
        str = br.readLine();
  
        System.out.println("input a number");
        **char a=char.parseChar(br.readLine(System.in));**
        String ustr = str.toUpperCase();
        int l = ustr.length();
        for (int x = 0; x &lt; l; ++x) {
           char t = ustr.charAt(x);
           if (('t' + a) &gt; 90) {
              char c = 90 - 't';
              char p = c - a;
              char d = 65 + p;
              System.out.print(d);
           } else {
              System.out.print('t' + a);
           }
        }
     }
  }
  </code></pre>
  
  <p>but it keeps on saying there is a mistake in the conversion of String to char.how do i fix it?</p>