Home »
Code Examples »
Groovy Code Examples
Groovy - Optional public keyword Code Example
The code for Optional public keyword
// By default, Groovy classes and methods are public
public class Server {
public String toString() { "a server" }
}
// Can be written as,
class Server {
String toString() { "a server" }
}
Code by IncludeHelp,
on December 28, 2022 21:47