Ask Question
17 November, 20:43

int[] num = new int[100]; for (int i = 0; i < 50; i++) num[i] = i; num[5] = 10; num[55] = 100; What is the value of num. length in the array above?1. 02. 1003. 994. 101

+4
Answers (1)
  1. 17 November, 22:20
    0
    Option 2: 100

    Explanation:

    The given code is regarding a Java array. To create an array in Java, the syntax is as follows:

    type [] arrayname = new type[size]

    In Java, this is possible to set a size for an array by giving an integer within the bracket. For example, int [] num = new int[100] will set the array size 100 for num. This means the num can hold 100 components within the array.

    Once the size is set for an array, the size cannot be changed in later stage.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “int[] num = new int[100]; for (int i = 0; i < 50; i++) num[i] = i; num[5] = 10; num[55] = 100; What is the value of num. length in the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers