summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing1205.java
blob: 852902f1cd68f7a88a75b9038e6fe4c65975737b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Listing1205.java */

public class Listing1205
{
  public static void main(String[] args)
  {
    int i, base = 0;

    for (base = 10; base >= 2; --base) {
      try {
        i = Integer.parseInt("40",base);
        System.out.println("40 base "+base+" = "+i);
      } catch (NumberFormatException e) {
        System.out.println(
          "40 ist keine Zahl zur Basis "+base
        );
      }
    }
  }
}