thatcooldude1908 thatcooldude1908
  • 04-07-2019
  • Computers and Technology
contestada

2) What is the value stored in the variable z by the statements below?

int[ ] q = {3, 2, -2, 4, 7, 0, 1};
int z = q.length;

a) 1
b) 3
c) 6
d) 7
e) None of the above

Respuesta :

PhantomWisdom PhantomWisdom
  • 12-07-2019

Answer:

7

Explanation:

Because the q.length is a inbuilt function in the programming which used to get the length of the array. In the array, there are 7 values are store. Therefore, the size 7 store in the variable z.

For example:

int[] array={1,2};

int x = array.length;

the answer of above code is 2, because the elements present in the array is 2.

 

Answer Link

Otras preguntas

Explain the weekly activity requirements for adults and what exercises and activities one can do to meet these requirements.
Which option presents citation information in the most credible way?
what does a Astrophysicist do?
A group of places that share a common feature is a what
What is the family's reaction to Gregor's death? A. Happiness that his life is finally over B. Sadness mixed with a sense of relief C. Terrible grief a
What is the best definition of “scrub suit”?
Write the standard form of the equation of the line with slope-3 passing through the point (-1,-6)
harold was 5 years older than Mary. In 10 years he found that 4 times his age exceeded twice Mary's age by only 50. How old were Harold and Mary in the beginnin
The answer to the problem?
is this correct? 11y+8 = 130 -8 -8 11y = 122 ÷11 ÷11 Y = 11.091