File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
src/org/j6toj8/languageenhancements/stringinswitch Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public static void getMonthName(final String may) {
1414 String apr = "apr" ;
1515
1616 switch (month ) {
17- case jan : // WON'T COMPILE - jan is a common attribute, can change at runtime
17+ case jan : // NOT COMPILING - jan is a common attribute, can change at runtime
1818 System .out .println ("January" );
1919 break ;
2020 case FEB : // COMPILES - FEB is a compilation time constant, its value never changes
@@ -23,10 +23,10 @@ public static void getMonthName(final String may) {
2323 case mar : // COMPILES - mar is a constant at compilation time, its value never changes
2424 System .out .println ("March" );
2525 break ;
26- case apr : // WON'T COMPILE - apr is a common variable, can change at runtime
26+ case apr : // NOT COMPILING - apr is a common variable, can change at runtime
2727 System .out .println ("April" );
2828 break ;
29- case may : // WON'T COMPILE - may is final but not constant, may change at runtime
29+ case may : // NOT COMPILING - may is final but not constant, may change at runtime
3030 System .out .println ("May" );
3131 break ;
3232 }
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public static void main(String[] args) {
1313 break ;
1414 default : // COMPILES - `Default` can be in any position
1515 break ;
16- case "jan" : // WON'T COMPILE - There is already case "jan"
16+ case "jan" : // NOT COMPILING - There is already case "jan"
1717 System .out .println ("January2" );
1818 break ;
1919 case "mar" :
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ public static void main(String[] args) {
77
88 Long month = 1L ;
99
10- switch (month ) { // WON'T COMPILE - Long is not a supported type.
10+ switch (month ) { // NOT COMPILING - Long is not a supported type.
1111 case 1L :
1212 System .out .println ("January" );
1313 break ;
You can’t perform that action at this time.
0 commit comments