Which of the following is the correct syntax to declare an ArrayList in Java?
A. ArrayList al = new ArrayList();
B. ArrayList al = new ArrayList[];
C. ArrayList al() = new ArrayList();
D. ArrayList al[] = new ArrayList[];
Answer:A
Which of the following is the correct syntax to declare an ArrayList in Java?
A. ArrayList al = new ArrayList(); B. ArrayList al = new ArrayList[]; C. ArrayList al() = new ArrayList(); D. ArrayList al[] = new ArrayList[];