Program to demonstrate return statement

/* Program to demonstrate return statement*/

class ReturnDemo
{
    public static void main(String args[ ])
    {
        boolean t = true;
        System.out.println("Before the return");

        if(t) return;    //return to caller

        System.out.println("This won't execute");
    }
}

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|