my question scenario is i have program in which arithmetic exception but i know how to catch exception.The thing is i need to store exception in some Data Structure,later i need to retrive,which Data structure is suitable. Here is my code.
public class ExceptionTest { public static void main(String[] args) { int i = 10, j = 0; try { System.out.println(i / j); } catch (Exception ex ) { //need to store exception in some DS(which one is best Suitable and why? System.out.println( ex.getMessage() ); } } } Please guide me.Your help will be appreciated.