jeudi 23 novembre 2017

return after if statement

I saw an if statement with a return in a new I never saw before and wanted to ask what it does.

//class variable
private boolean isRunning = false;


public synchronized void start()
{
if(isRunning)return;
isRunning = true;
}

What is this code doing ?

Aucun commentaire:

Enregistrer un commentaire