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?

  1. int[] arr = {1, 3, 5};
  2. int[] arr;
  3. arr = new int[] {3, 1, 8};
  4. int arr[] = {1, 4, 6};
  5. All of these

Answer: E) All of these

Explanation:

Read here: How to declare and initialize an array in Java?

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.