How do you get the size of an array and an ArrayList respectively?

Practice More Questions From: Quiz 04 – Arrays & ArrayLists

Q:

Which of the following is correct to create an array in Java?

Q:

Which of the following is correct to create an ArrayList in Java?

Q:

How do you get the size of an array and an ArrayList respectively?

Q:

What is the length of the array arr? int[] arr = {0, 1, 2, 3, 4, 5, 6};

Q:

What is the result of the following code? public static void main(String[] args) { int[] arr = {10, 20, 30, 40, 50}; for(int i = 0; i <= 5; i++) { System.out.print(" " + arr[i]); } }

Q:

Which way is correct to add the element a to the last position of the ArrayList myList?

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments