The return statement in Java

import java.util.*;

public class ReturnEx {
    public static void main(String[] args) {
        boolean value = true;
        System.out.println("Before return statment.");
        if (value)
            return;
        System.out.println("This will not be printed.");
    }
}

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *