Created
July 13, 2009 12:22
-
-
Save erikbgithub/146082 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShowIf { | |
public void printWay(boolean A, boolean B) { | |
if(A && B) { | |
System.out.println("A ist wahr, und auch B"); | |
} else if(A) { | |
System.out.println("A ist wahr, aber nicht B"); | |
} else if(B) { | |
System.out.println("B ist wahr, aber nicht A"); | |
} else { | |
System.out.println("weder A noch B ist wahr"); | |
} | |
//just for some good lucking space between outputs | |
System.out.println(); | |
} | |
public static void main(String[] args) { | |
ShowIf sut = ShowIf(); | |
sut.printWay(true, true); | |
sut.printWay(true, false); | |
sut.printWay(false, true); | |
sut.printWay(false, false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment