logo Practice-It logo

BJP4 Self-Check 4.20: charMystery

Language/Type: Java char classes method basics mystery
Author: Will Beebe (on 2016/09/08)

What output is produced by the following program?

public class CharMystery {
    public static void printRange(char startLetter, char endLetter) {
        for (char letter = startLetter; letter <= endLetter; letter++) {
            System.out.print(letter);
        }
        System.out.println();
    }

    public static void main(String[] args) {
        printRange('e', 'g');
        printRange('n', 's');
        printRange('z', 'a');
        printRange('q', 'r');
    }
}
printRange('e', 'g');
printRange('n', 's');
printRange('z', 'a');
printRange('q', 'r');

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.