KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > T151811r2


1
2 class T151811r2 {
3     public static void main(String JavaDoc args[]) {
4     char[] c = null;
5         try {
6             String JavaDoc s = "" + c;
7             if (s.equals("null"))
8                 System.out.print("OK");
9             else
10             System.out.print("WRONG string");
11         } catch (NullPointerException JavaDoc e) {
12             System.out.print("WRONG method");
13         }
14     }
15 }
16     
Popular Tags