GoConqr has a new look! Let us know what you think.

Quiz

chapter 11 quiz

Joe Delisle 106 questions

Take the quiz

Questions in this quiz (106)

  1. 1Suppose an ArrayList list contains {"red", "green", "red", "green"}. What is the list after the following code?Image for question 1
    1. A{"red", "green", "red", "green"}
    2. B{"green", "red", "green"}
    3. C{"green", "green"}
    4. D{"red", "green", "green"}
  2. 2Which of the following statements is false?
    1. AA public class can be accessed by a class from a different package.
    2. BA private method cannot be accessed by a class in a different package.
    3. CA protected method can be accessed by a subclass in a different package.
    4. DA method with no visibility modifier can be accessed by a class in a different package.
  3. 3Invoking ________ removes all elements in an ArrayList x.
    1. Ax.remove()
    2. Bx.clean()
    3. Cx.delete()
    4. Dx.empty()
    5. Ex.clear()
  4. 4What is the output of the following code?Image for question 4
    1. Afalse false
    2. Btrue true
    3. Cfalse true
    4. Dtrue false
  5. 5The UML uses ________ before a member name to indicate that the member is private.
    1. A+
    2. B-
    3. C#
    4. D?
  6. 6Analyze the following code.Image for question 6
    1. AProgram 1 displays true and Program 2 displays true
    2. BProgram 1 displays false and Program 2 displays true
    3. CProgram 1 displays true and Program 2 displays false
    4. DProgram 1 displays false and Program 2 displays false
  7. 7You can create an ArrayList using ________.
    1. Anew ArrayList[]
    2. Bnew ArrayList[100]
    3. Cnew ArrayList()
    4. DArrayList()
  8. 8You can use the operator == to check whether two variables refer to the same object, and use the equals() method to check the equality of contents of the two objects.
    1. ATrue
    2. BFalse
  9. 9The printout from the following code is ________.

    java.util.ArrayList<String> list = new java.util.ArrayList<String>();
    list.add("New York");
    java.util.ArrayList<String> list1 = list;
    list.add("Atlanta");
    list1.add("Dallas");
    System.out.println(list1);
    1. A[New York]
    2. B[New York, Atlanta, Dallas]
    3. C[New York, Dallas]
    4. D[New York, Atlanta]
  10. 10________ can search in an unsorted list.
    1. ALinear search
    2. BBinary search

Information

Description
Quiz on chapter 11 quiz, created by Joe Delisle on 10/02/2018.
Language
English
Views
2
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?