FileDocCategorySizeDatePackage
IfElseDemo.javaAPI DocExample474Tue Dec 12 18:58:12 GMT 2000None

IfElseDemo

public class IfElseDemo extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


        int testscore = 76;
        char grade;

        if (testscore >= 90) {
            grade = 'A";
        } else if (testscore >= 80) {
            grade = 'B";
        } else if (testscore >= 70) {
            grade = 'C";
        } else if (testscore >= 60) {
            grade = 'D";
        } else {
            grade = 'F";
        }
        System.out.println("Grade = " + grade);