Re: Constant methods in Java

2022-02-02 Thread Aaron Scott-Boddendijk
the method to declare the variable b to be final. > Stated otherwise, what is the problem addressed by this suggestion? > Have you some specific case in mind? > > > Greetings > Raffaello > > > On 2022-02-02 20:27, Alberto Otero Rodríguez wrote: > > I have a suggestion. I thi

Re: Constant methods in Java

2022-02-02 Thread Raffaello Giulietti
20:27, Alberto Otero Rodríguez wrote: I have a suggestion. I think it would be interesting creating constant methods in Java. I mean methods declared like this: public const String myMethod() { String a = "a"; a = a + "b"; return a; } So that the response of

Constant methods in Java

2022-02-02 Thread Alberto Otero Rodríguez
I have a suggestion. I think it would be interesting creating constant methods in Java. I mean methods declared like this: public const String myMethod() { String a = "a"; a = a + "b"; return a; } So that the response of the method is forced to be assigned