We received the following error when we ran your code:
./src/main/java/Greeter.java:1: error: unnamed classes are a preview feature and are disabled by default.
String getGreeting() {
^
(use --enable-preview to enable unnamed classes)
./src/main/java/Greeter.java:1: error: unnamed classes are a preview feature and are disabled by default.
String getGreeting() {
^
(use --enable-preview to enable unnamed classes)
Without seeing all of your code, it’s pretty hard to comment on it. But you probably want to use the … menu in the top right to reset the exercise and watch the introduction video before changing anything.
String getGreeting() {
return “Hello World!”;
}
class Greeter {
String getGreeting() {
return "Hello World!";
}
}
Those two are very different. The second one should run and get you some output.