There is a lot more to it than that. Have you tried it yourself?
Fikri Harlov wrote:. . . If method display() contains 20 lines source code, it will be ugly to be in the forEach() . . .
I am getting the impresssion that we are going in circles about things that don't actually matter.
Monica Shiralkar wrote:. . . I think in actual it is an object that it accepts (not interface). . . .
Just like RM, I am unable to compile your code because some is missing. I can see some errors however. For example, the above is not a default constructor. I don't know whether it is a good idea to overload the constructor name like that.
Juan Hidalgo wrote:. . .. . .
A long time ago I was at a well‑known University in LA and the email system had such censorship. I had something to drink and then thought I would wash it down with some beer. And the system changed that to, “waXX XX down…”
Babu Muthukrishnan wrote:. . . the program will replace the bad word with asterisks . . .