Site hosted by Angelfire.com: Build your free website today!
 

Return Statement

If the return type of a method is not void, a return statement is required.

static boolean integerLarger(int tmpInt, double tmpDbl) { 
    boolean tmpResult = false; // local variable 
    if ((double)tmpInt > tmpDbl) {
       tmpResult = true; 
    } 
    return tmpResult; 
}
  • Return the boolean true if tmpInt is greater than tmpDbl.