|
|
|
|
|
by boxed
272 days ago
|
|
> If you can't have other top-level functions in Java, then it's a special case, which is ugly. I assumed this meant that you could have free functions, but you're saying you can ONLY have `main` as a free function? Ok, then I agree this is also garbage. |
|
```Top-level members are interpreted as members of the unnamed class, so we can also write the program as:
String greeting() { return "Hello, World!"; }
void main() { System.out.println(greeting()); }```