Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions