@@ -0,0 +1,977 @@
+public class Cipher %7B%0A    public static void main(String%5B%5D args) %7B%0A%0A        String str = %22The quick brown fox Jumped over the lazy Dog%22;%0A%0A        System.out.println( Cipher.encode( str, 12 ));%0A        System.out.println( Cipher.decode( Cipher.encode( str, 12), 12 ));%0A    %7D%0A%0A    public static String decode(String enc, int offset) %7B%0A        return encode(enc, 26-offset);%0A    %7D%0A%0A    public static String encode(String enc, int offset) %7B%0A        offset = offset %25 26 + 26;%0A        StringBuilder encoded = new StringBuilder();%0A        for (char i : enc.toCharArray()) %7B%0A            if (Character.isLetter(i)) %7B%0A                if (Character.isUpperCase(i)) %7B%0A                    encoded.append((char) ('A' + (i - 'A' + offset) %25 26 ));%0A                %7D else %7B%0A                    encoded.append((char) ('a' + (i - 'a' + offset) %25 26 ));%0A                %7D%0A            %7D else %7B%0A                encoded.append(i);%0A            %7D%0A        %7D%0A        return encoded.toString();%0A    %7D%0A%7D%0A

caesar cipher java