Search Header Logo

Finals Review Practice

Authored by Devon Morgan

Computers

University

Used 1+ times

Finals Review Practice
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

What is the default value of an element in an array of integers in Java?

0

null

1

undefined

2.

MULTIPLE SELECT QUESTION

2 mins • 2 pts

How do you Declare an array of integers in Java?

int array[];

array int[];

int[] array;

Both A and C

3.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

What will be the output of the following code?

int[] arr = new int[5];
System.out.println(arr[2]);

null

0

2

Error

4.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

Which of the following is true about arrays in Java?

The length of an array can be changed after it's created

Arrays in Java are Objects

Arrays can contain differentt ypes of data

All elements in an array must be initialized manually

5.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

What is the correct way to find the length of an Array in Java?

array.length()

array.size()

array.length

length(array)

6.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

Which of the following methods is used to add an element to an ArrayList in Java?

push()

add()

insert()

append()

7.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

What will be the output of the following code?
ArrayList<String> list = new ArrayList<>();

list.add("Hello");
list.add("My");
list.add("Name");

System.out.println(list.get(1));


null

Error

Hello

My

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?