void (int width, int height, boolean someFlag) { int a = Math.max(width, height); int b = Math.min(width, height); if (someFlag) { System.out.println("a=" + a + ", b=" + b); } else { System.out.println("a=" + b + ", b=" + a); } }