summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing1207.java
blob: 7992aaae3d545757b581649c44c9ca5218bcf5bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Listing1207.java */

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

    try {
      for (base = 10; base >= 2; --base) {
        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
      );
    } finally {
      System.out.println(
        "Sie haben ein einfaches Beispiel " +
        "sehr gl�cklich gemacht."
      );
    }
  }
}