/** * Poor exception handling. * * @author gtowell Created: Feb 11, 2020 */ public class CatchErr2 { /** * Poor exception handling * 1. The try catch block encloses whole method * 2. The catch block is empty. * 3. The exception caught is not specific * @param args ignored */ public static void main(String[] args) { int[] a = new int[10]; try { for (int i = 0; i <= 10; i++) { System.out.println(a[i]); } System.out.println("Done printing the array!"); } catch (Exception e) { } } }