Comment From: quaff
Semicolon is not required by java enum and groovy.
Comment From: diguage
Semicolon is not required by java enum and groovy.
I tried it on the IDEA. It is necessary for Java enum.
Comment From: quaff
https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html#PageContent
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, SATURDAY
}
Comment From: diguage
https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html#PageContent
java public enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY }
You are right.
The semicolon is not necessary for the first code in the PR.
Thanks a lot.
This is my code:
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, SATURDAY
Day() {
}
public static void main(String[] args) {
System.out.println(Day.SATURDAY);
}
}
// Then throw an error:
error: ',', '}', or ';' expected
Tesssst() {
^
Comment From: quaff
You should close this since semicolon is optional in groovy.
Comment From: diguage
You should close this since semicolon is optional in groovy.
The source blocks are Java source. So semicolons should be added.
Comment From: sbrannen
Semicolon is not required by java enum and groovy.
Closing this in light of the above.
Comment From: diguage
Closing this in light of the above.
I have removed the enum source block.
The change is Java source block. So maybe the semicolons are necessary.
Comment From: sbrannen
The remaining changes are in Groovy source code examples.
The fact that java is listed as the source type is only for syntax highlighting purposes.