聪聪工作室---JAVA入门小程序 part-2

package congcong;

public class monkeyTrouble {

public static void main(String[] args) {

// TODO Auto-generated method stub

boolean a=monkeyTrouble(true,true);

boolean b=monkeyTrouble(false,false);

boolean c=monkeyTrouble(true,false);

System.out.println(a);

System.out.println(b);

System.out.println(c);

}

private static boolean monkeyTrouble(boolean aSmile, boolean bSmile) {

// TODO Auto-generated method stub

if(aSmile&&bSmile){

return true;

}else if(!aSmile&&!bSmile){

return true;

}else{

return false;

}

}

}


你可能感兴趣的:(聪聪工作室---JAVA入门小程序 part-2)