Given below the sample code :
public class Check{
public static void main(String... args) {
ArrayList<Integer> alist = new ArrayList<Integer>();
alist.add(3);
alist.add(12);
alist.add(21);
alist.add(30);
for(int a : alist)
System.out.println(a);
}
}
What will be the output of the above code ?
1. compile error
2. 3 12 21 30
3. 0 0 0 0
4. 30 21 12 3
(2)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.