#Execute code on thread end

9 messages · Page 1 of 1 (latest)

flint current
#

Runnable r = () -> {
};
Thread conversion = new Thread(r);
conversion.start();

in an example like this, how can i make a piece of code execute when the thread finishes or gives an error?

violet pewterBOT
#

This post has been reserved for your question.

Hey @flint current! 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.

dense fern
#

Add said code at the end of the Runnable

flint current
dense fern
#

Use try / catch

flint current
#

oh ok

#

right makes sense

flint current