alim586
Quiz by , created more than 1 year ago

OCA Java 7 SE OCA Java SE 7 (Arrays) Quiz on ArrayList Quize, created by alim586 on 19/06/2015.

28
0
0
alim586
Created by alim586 over 9 years ago
Close

ArrayList Quize

Question 1 of 8

1

You can increase and decrease the size of an Array

Select one of the following:

  • True
  • False

Explanation

Question 2 of 8

1

Which of the properties are the properties of an ArrayList?

Select one or more of the following:

  • It implements the interface List

  • It maintains it insertion

  • It doesn't allow duplicate value to be added to it

  • It allows null values to be added

Explanation

Question 3 of 8

1

What happens when you create the following object of an ArrayList?

ArrayList<String> anArrList = new ArrayList<>();

Select one of the following:

  • the no-argument constructor defined in the class ArrayList.java, constructs an empty list with an initial capacity of ten

  • the no-argument constructor defined in the class ArrayList.java, construct an empty list with an no capacity

  • Non of the above

Explanation

Question 4 of 8

1

Which of the statements are true ?

Select one or more of the following:

  • ArrayList defines a instance variable of type List to store all it's individual elements

  • ArrayList defines a instance variable of type Array to store all it's individual elements

  • The capacity of the ArrayList is the length of this instance variable

  • All are true

Explanation

Question 5 of 8

1

The reference to the instance variable that stores the element of the ArrayList is: elementData

Select one of the following:

  • True
  • False

Explanation

Question 6 of 8

1

The method addAll (Collection<? extends E> c) appends all the elements in the specified collection's to the end of this list, in the order they're returned by the specified iterator.

Select one of the following:

  • True
  • False

Explanation

Question 7 of 8

1

An Array can accept duplicate object values

Select one of the following:

  • True
  • False

Explanation

Question 8 of 8

1

What does clone method defined in the class ArrayList doe ? Which of the statements are true?

Select one of the following:

  • It creates a new instance of the ArrayList to be cloned

  • It copies the element references, but not the objects

  • Both of the answers are true

  • Non of the above

Explanation