package com.returntest1;
public class Test {
int a = 0;
public static void main(String args[]) {
Test t = new Test();
System.out.println(t.method());
}
private boolean method() {
if (a == 1) {
System.out.println("true---");
return true;
}
System.out.println("false----");
return false;
}
}
if(){return XXX;},相当于if{} else{}