System.out.println("Enter the input array n");
ArrayList<Integer> list = new ArrayList<Integer>();
Scaer sc = new Scaer(System.in);
while(sc.hasNext()){
list.add(sc.nextInt());
}
int[] inputArray = new int[list.size()];
for(int i = 0;i<inputArray.length;i++){
inputArray[i] = list.get(i);
}
I have tried using this code but I am getting a run time exception. i am unable to figure out mistake.
