Lambda Expression
Guys I had a question regarding lambda expressions in Java, when the abstract method from the functional interface requires a parameter, is the parameter not mandatory to be inputted in the code block you pass into the abstract method?
5 Replies
β
This post has been reserved for your question.
Hey @valer! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
i cant quite figure out what the second part of the question is. do you mean that the parameter is optional in the lambda? no, it's mandatory
if you do
the lambda needs to be
optionally you can also do
(String arg) -> /* something */;
You can also name that parameter β_β since a couple of Java versions.
In case you donβt plan on using it.
π€
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
Post Closed
This post has been closed by <@1265852855458332673>.