Ask Question
27 July, 02:32

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

+1
Answers (1)
  1. 27 July, 04:21
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers