Home »
MCQs »
Java MCQs
Which of these is the correct method to create an array in java?
25. Which of these is the correct method to create an array in java?
- int[] arr = {1, 3, 5};
- int[] arr;
- arr = new int[] {3, 1, 8};
- int arr[] = {1, 4, 6};
- All of these
Answer: E) All of these
Explanation:
Read here: How to declare and initialize an array in Java?