PR144 (aligned patchers on x86_64)
[cacao.git] / tests / network / whatip2.java
1 import java.io.*;
2 import java.net.*;
3
4 class whatip2 {
5     static void output (InetAddress addr) {
6         if (addr == null) {
7             System.out.println("address is null");
8         } else {
9             System.out.println("inet address is " + addr.toString() );
10         }
11     }
12
13     public static void main(String a[]) throws IOException {
14         try {
15             System.out.println("hostname is " + a[0] );
16
17             output(InetAddress.getByName (a[0]));
18
19             output(InetAddress.getLocalHost());
20         }
21         catch (Throwable t) {
22             System.out.println("Catched error " + t.toString() );
23         }
24     }  
25 }