Write a Java method to print characters between two characters (i.e. A to P).

Source Code:

public class PrintCharacters {
public static void main(String[] args) {
printChars(‘A’, ‘P’);
}

public static void printChars(char c1, char c2) {
for (char c = c1; c <= c2; c++) {
System.out.print(c + " ");
}
}
}

Output: