The Caesar cipher replaces each letter by the letter shift places further in the alphabet, going back to A after Z. CaesarWord reads a word of exactly four capital letters and a shift from 0 to 25, and prints the position of the first letter in the alphabet (A is 0), the secret word, and the secret word decoded again.
One letter is encoded with
char c0 = (char) ('A' + (word.charAt(0) - 'A' + shift) % 26);
No loop yet: write the line four times. For the input
JAVA 3
the program prints
Position of J in the alphabet: 9
Secret word: MDYD
Decoded again: JAVA