blob: 7d6dc801224ff65d72c95d4754a615888a3a488d [file] [log] [blame]
Mads Ager418d1ca2017-05-22 09:35:49 +02001// Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5public class MultipleReturns {
6
7 public static void main(String[] args) {
8 int resultIfTrue = multipleReturns(true);
9 int resultIfFalse = multipleReturns(false);
10 System.out.println("resultIfTrue=" + resultIfTrue);
11 System.out.println("resultIfFalse=" + resultIfFalse);
12 }
13
14 public static int multipleReturns(boolean condition) {
15 if (condition) {
16 return Integer.MAX_VALUE;
17 } else {
18 return Integer.MIN_VALUE;
19 }
20 }
21
22
23}