C4 Week10Monday

C4 Week10Monday

Assessment

Assessment

Created by

Ahmetcan türk

Other

Professional Development

7 plays

Medium

Student preview

quiz-placeholder

5 questions

Show all answers

1.

MULTIPLE CHOICE

30 sec • 1 pt

Declare and construct an ArrayList with an initial capacity of 20 references to Object.

2.

MULTIPLE CHOICE

30 sec • 1 pt

Examine the following code:

ArrayList<String> list = new ArrayList<String>(10) ;

list.add( "Ann" );

list.add( "Bob" );

list.add( "Eve" );

After the code has executed, what is the capacity of list? What is its size?

3.

MULTIPLE CHOICE

30 sec • 1 pt

Examine the following code:

ArrayList<String> list = new ArrayList<String>(10) ;


list.add( "Andy" );

list.add( "Bart" );

list.add( "Carl" );

list.add( 0, "Eve" );

What element will be at index 2 of the list?

4.

MULTIPLE CHOICE

30 sec • 1 pt

Examine the following code:

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


list.add( "Andy" );

list.add( "Bart" );

list.add( "Carl" );

list.add( "Doug" );

list.add( "Elmo" );

Which of the following will replace the element "Carl" with "Zoltan" ?

5.

MULTIPLE CHOICE

30 sec • 1 pt

-Contains no duplicate elements.

-Can contain at most one Null value.

-Elements are not key-value pairs.

-Accessing an element can be almost as fast as performing a similar operation on an array.


Which of these classes provides the specified features?