Check out example codes for "caesar cipher java". It will help you in understanding the concepts better.

Code Example 1

public static String incode(String strIn, int delta) {
        String strOut = "";

        // bring delta to positive value
        while (delta < 0) {
            delta += 26;
        }

        for (int i = 0; i < strIn.length(); i++) {
            char c = strIn.charAt(i);

            if (Character.isAlphabetic(c)) {
                char startLetter = Character.isUpperCase(c) ? 'A' : 'a';    // convert [a, z] to [0, 25]
                strOut += (char) ((c - startLetter + delta) % 26 + startLetter);
            } else {
                strOut += c;
            }
        }

        return strOut;
    }

public static String decode(String strIn, int delta) {
        return incode(strIn, -delta);
    }

Learn ReactJs, React Native from akashmittal.com