jeudi 8 janvier 2015

What does this code, what does "if" followed return statement [duplicate]


This question already has an answer here:




I want to know what is going to do the if statement when is followed by return statement like this.



public static boolean running = false;
public Thread gameThread;

public synchronized void start(){
if (running)return; // Here.
running = true;
gameThread = new Thread();
gameThread.start();
}

Aucun commentaire:

Enregistrer un commentaire