The SAMATE Project Department of Homeland Security
Downloads:  Selected

Back to the previous page...Back to the previous page

Test Case IDCandidate71
Bad / GoodBadBad test case
AuthorN/A
Associated test caseN/A
ContributorSecureSoftware
LanguageJava
Type of test caseSource Code
Input stringN/A
Expected OutputN/A
InstructionsN/A
Submission date2005-11-07
DescriptioniconOmitting a break statement so that one may fall through is often indistinguishable from an error, and therefore should not be used. (from TCCLASP-5_6_15_10)
Filename

There is no comments :: Submit a comment :: RSS

>./Omitted_break_statement.java
  1. {
  2. int month = 8;
  3. switch (month) {
  4. case 1: print("January");
  5. case 2: print("February");
  6. case 3: print("March");
  7. case 4: print("April");
  8. case 5: println("May");
  9. case 6: print("June");
  10. case 7: print("July");
  11. case 8: print("August");
  12. case 9: print("September");
  13. case 10: print("October");
  14. case 11: print("November");
  15. case 12: print("December");
  16. }
  17. println(" is a great month");
  18. }