Given the lines of a Java program that performs increment and decrement operations on a character, your task is to reorder these lines correctly. The intended program should first initialize a character 'A', increment its Unicode value to get the next letter in the alphabet, and then print the result. After that, the program should decrement the Unicode value to get back to the initial character and print that out.
Characters
Incrementing and decrementing a character
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
}
public class Main {
char letter = 'A';
letter--;
public static void main(String[] args) {
System.out.println("We are back at: " + letter);
System.out.println("Next letter after A is: " + letter);
letter++;
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.