#lambda as Thread() argument?

6 messages · Page 1 of 1 (latest)

sleek pilot
#

hi, new to java and wanted to learn multithreading and i saw a snippet like that (client is a Socket captured just above)
what's the point of the lambda? is it to pass an argument alongside the method?

obsidian ospreyBOT
#

This post has been reserved for your question.

Hey @sleek pilot! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

quasi bronze
#

well, take a look at the Thread constructor in question:

#

the lambda here fulfills a Runnable, it tells the thread what to do