RosettaCodeData/Task/Extend-your-language/Java/extend-your-language-1.java

14 lines
432 B
Java

public class If2 {
public static void if2(boolean firstCondition, boolean secondCondition,
Runnable bothTrue, Runnable firstTrue, Runnable secondTrue, Runnable noneTrue) {
if (firstCondition)
if (secondCondition)
bothTrue.run();
else firstTrue.run();
else if (secondCondition)
secondTrue.run();
else noneTrue.run();
}
}