You could potentially use a trait?

trait MyTrait {
    abstract myFunction(String parameter1 = "1234")
}

class MyClass implements MyTrait {
    def myFunction(String parameter1) {
        parameter1.reverse()
    }
}

assert new MyClass().myFunction() == '4321'


On Tue, Jan 5, 2021 at 1:22 PM Saravanan Palanichamy <[email protected]>
wrote:

> Hello
>
> Are there plans to support default parameters in interface methods
>
> interface MyClass {
>     def myFunction(String parameter1 = "1234")
> }
>
> the error I get is Cannot specify default value for method parameter
> inside an interface
>
> regards
> Saravanan
>

Reply via email to