1. public static void main(String[] args) {2. try {3. args = null;4. args[0] = "test";5. System.out.println(args[0]);6. } catch (Exception ex) {7. System.out.println("Exception");8. } catch (NullPointerException npe) {9. System.out.println("NullPointerException");10. }11. }