This program does what I want it to do but it also outputting a massive big error. Which says something like "array out of bounds. string index out of bounds". The program is meant to take an input of a sentence and rewrite it using different letters (4 characters up) from the alphabet. Please help me clear up this error!
public class Encryption
{
public static void main (String [] args)
{
System.out.print("Enter a message to encrypt: ");
String input = Console.readString();
for(int i = 0; i<100; i++)
{
char oldChar = input.charAt(i);
char encryptedChar = (char) (oldChar + 4);
System.out.print(encryptedChar);
}
}