aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Programming and IT Security Basics
  • Consider the code below: arr[0] = new int[4]; arr[1] = ne...
Multiple choice technology

Consider the code below: arr[0] = new int[4]; arr[1] = new int[3]; arr[2] = new int[2]; arr[3] = new int[1]; for( int n = 0; n < 4; n++ ) System.out.println( /* what goes here? */ );

  1. arr[n].length();

  2. arr.size;

  3. arr.size-1;

  4. arr[n].length;

Reveal answer Fill a bubble to check yourself
C Correct answer

Keep practicing — related questions

  • Given the following code fragment:int A[];int i = 0;A = new int A[4];while (i < 4){A[i] = 10;i = i + 1;}
  • Given the following code fragment: int A[]; int i = 0; A = new int A[4]; while (i < 4) { A[i] = 10; i = i +...
  • int i,j; int ctr = 0; int myArray[2][3]; for (i=0; i<3; i++) for (j=0; j<2; j++) { myArray[j][i] = ctr; ++c...
  • Given the following code fragment: int A[]; int i = 0; A = new int A[4]; while (i < 4) { A[i] = 10; i = i +...
  • Consider the following line of code: int x[] == new int[25]; After execution, which statement or statements...
  • int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; What value does testarray[2][1][0] in the...
  • Which are the values in arr after execution of following.. Int[]arr={1,1,0,0,0}; for(int i=2;i < arr.length...
  • How do you create an array of 20 integers?
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy