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

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.