Which two statements are true for a two-dimensional array?

Which two statements are true for a two-dimensional array?

Which two statements are true for a two-dimensional array?

A.
It is implemented as an array of the specified element type.

B.
Using a row by column convention, each row of a two-dimensional array must be of the same size

C.
At declaration time, the number of elements of the array in each dimension must be specified

D.
All methods of the class Object may be invoked on the two-dimensional array.

Explanation:

Two-dimensional arrays are defined as “an array of arrays”. Since an array type is a first-class Java
type, we can have an array of ints, an array of Strings, or an array of Objects (A).
There are a couple of interesting consequences of this: Rows may be different sizes (not B). Also,
each row is an object (an array) that can be used independently.



Leave a Reply 7

Your email address will not be published. Required fields are marked *


Carlos

Carlos

this test is useless, maximum five exam questions are here. I failed the test.

Vinicius.Souza

Vinicius.Souza

Result A,D.

sully

sully

think a,d
if it’s a normal array maybe C but with arrayList you don’t have to specify

pooja

pooja

A D are correct

kishor

kishor

AandD are correct answers