summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/AssertionTest.java
blob: 1ac134405c1b3bada200c028a33bbbf38624c523 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* AssertionTest.java */

public class AssertionTest
{
  public static void main(String[] args)
  {
    assert args.length >= 2; 
    int i1 = Integer.parseInt(args[0]);
    int i2 = Integer.parseInt(args[1]);
    assert i2 != 0 : "Teilen durch 0 nicht moeglich"; 
    System.out.println(i1 + "/" + i2 + "=" + (i1/i2));
  }
}