Question: Answer the Questions(Multiple Choice ): Question 21 Which statement will return the number of rows in a two dimensional array a? a. int a =

Answer the Questions(Multiple Choice):

Question 21

Which statement will return the number of rows in a two dimensional array a?

a.

int a = a.rows

b.

int a = a.length

c.

int a = a[i].length

d.

int a = a.size

2.5 points

Question 22

What statement(s) could you use to declare and instantiate an ArrayList object reference of Book objects named library with a default capacity of 10 elements?

a.

ArrayList library = new ArrayList();

b.

ArrayList library;

library = new ArrayList();

c.

both a and b

d.

neither a or b

2.5 points

Question 23

What method of an arraylist class object returns the number of elements in an ArrayList object?

a.

size()

b.

capacity

c.

length

d.

length( )

2.5 points

Question 24

After the following code sequence is executed, what are the contents at ArrayList index 1 in a?

ArrayList a = new ArrayList( ); a.add( 7 ); a.add( 10 ); a.add( 21 ); a.set( 1, 4 ); a.remove( 0 );

a.

10

b.

7

c.

4

d.

21

2.5 points

Question 25

Which of the following is inherited by a subclass

a.

all instance variables and methods

b.

public instance variables and methods only

c.

protected instance variables and methods only

d.

protected and public instance variables and methods

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!