Arrays And Array Lists In Java Quiz!

11 Questions | Total Attempts: 1327

SettingsSettingsSettings
Please wait...
Array Quizzes & Trivia

This quiz will test your knowledge about arrays and array lists in Java.


Questions and Answers
  • 1. 
    What is an array?
    • A. 

      A random integer.

    • B. 

      A program that you can use to execute another program and anlyze its run-time behavior.

    • C. 

      A sequence of values.

  • 2. 
    How do you access an array element?
    • A. 

      By the name of the array followed by the index value in brackets.

    • B. 

      By the name of the array followed by a dot and then the index value.

    • C. 

      By the index value followed by a dot and then the name of the array.

  • 3. 
    What is the index value of the first element?
    • A. 

      -1

    • B. 

      0

    • C. 

      1

    • D. 

      2

  • 4. 
    What is the Enhanced for Loop?  
    • A. 

      It keeps going until the user enters a certain, previously specified value.

    • B. 

      It transverses all elements of a collection.

    • C. 

      It never ends.

  • 5. 
    What does a Two-Dimensional Array do?  
    • A. 

      It forms a tabular, two dimensional arrangement.

    • B. 

      It creates two arrays at once.

    • C. 

      It creates an array with only two elements.

  • 6. 
    How do you access an array element?  
    • A. 

      Variable = name[i];

    • B. 

      Variable = i.name;

    • C. 

      Variable = name.get(i);

  • 7. 
    Which is true about wrapper classes? i)  All wrapper class names start with upper case letters.ii) They are used to treat primitive type values as objects for array lists.iii) They are imperitive to use whenever an array is used.
    • A. 

      i only

    • B. 

      Ii only

    • C. 

      I, ii, iii

    • D. 

      I, ii only

  • 8. 
    What is auto-boxing?
    • A. 

      It is the automatic conversion between primitive types and the corresponding wrapper classes.

    • B. 

      It is when the program creates rectangles without the user having to enter location values.

    • C. 

      It comes up when entered information is invalid.

  • 9. 
    True or False: Auto-wrapping is another name for auto-boxing.
    • A. 

      True

    • B. 

      False

  • 10. 
    Which is not true about regression testing?
    • A. 

      Regression testing involves repeating previously run tests to ensure that known failures of prior versions do not appear in new versions of the software.

    • B. 

      Regression testing disgards old test cases, therefore it is difficult to get feedback.

    • C. 

      Regression testing can be used anytime you are able to test two versions of the same program.

  • 11. 
    Which of the following are common errors when using arrays and array lists?i)   Bounds errorsii)  Underestimating the size of a data setiii) Confusing length and size
    • A. 

      I and ii only

    • B. 

      I and iii only

    • C. 

      Ii and iii only

    • D. 

      I, ii, and iii

Back to Top Back to top