/ Published in: Java
- Tiger simply requires that you not preface each enumerated type with the enum class name
- if not handling every enumerated type - warining will be displayed that not all of enum values not being compile time constants
- if not handling every enumerated type - warining will be displayed that not all of enum values not being compile time constants
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
switch (student1.getGrade( )) { case A: outputText.append(" excelled with a grade of A"); break; case B: // fall through to C case C: outputText.append(" passed with a grade of ") .append(student1.getGrade( ).toString( )); break; case D: // fall through to F case F: outputText.append(" failed with a grade of ") .append(student1.getGrade( ).toString( )); break; case INCOMPLETE: outputText.append(" did not complete the class."); break; } out.println(outputText.toString( )); }