Java-Chapter 18 Exam

Java-Chapter 18 Exam

12th Grade

20 Qs

quiz-placeholder

Similar activities

Common Protocols

Common Protocols

10th - 12th Grade

15 Qs

Topic 4.1 Introduction to Java

Topic 4.1 Introduction to Java

12th Grade

20 Qs

Animated Canvas

Animated Canvas

9th - 12th Grade

19 Qs

N+ Chapter 5

N+ Chapter 5

12th Grade

20 Qs

Coding Karel 2

Coding Karel 2

KG - University

20 Qs

Computer Hardware - CPU & GPU

Computer Hardware - CPU & GPU

7th Grade - University

16 Qs

Bài 1 Excel - thẻ Home

Bài 1 Excel - thẻ Home

12th Grade

20 Qs

Skill Competition Quiz 2024

Skill Competition Quiz 2024

10th Grade - University

20 Qs

Java-Chapter 18 Exam

Java-Chapter 18 Exam

Assessment

Quiz

Computers

12th Grade

Practice Problem

Medium

Created by

Sundi Tiller

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following types of data can be stored in arrays?

Primitive data types

strings

References to any kind of object

All of these can be stored in arrays

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When the line of code below is run, what values will be stored in each of the array elements? int[] teamScores = new int[5];

0

null

false

Java doesn't define an initial value, so the contents are random

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which answer will correctly declare and initialize a 5-element array with specific numeric values?

int[] teamScores = new int(10,5,17,20,3);

int teamScores = (10,5,17,20,3);

int[] teamScores = {10,5,17,20,3};

int[] teamScores = new int[10,5,17,20,3];

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the minimum and maximum valid array index values for a 5-element array?

0 and 5

0 and 4

1 and 4

1 and 5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the code below, which statement will correctly set the very first array element equal to 10? int[] teamScores = new int[5];

teamScores(1) = 10;

teamScores[0] = 10;

teamScores[10] = 0;

teamScores = 10;

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If the Score class has been defined, how many unique Score objects are created by the following code?

Score[] teamScores = new Score[4];

teamScores[0] = new Score();

teamScores[1] = new Score();

teamScores[2] = teamScores[1];

1

3

2

4

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If the Score class has been defined, what phrases should replace the ??? marks to set up a standard for() loop to iterate over the entire array?

Score[] teamScores = new Score[4];

for (???)

{

teamScores[i] = new Score();

}

int i=1; i<teamScores.length- 1; i++

int i=0; i<=teamScores.length; i++

int i=1; i<=teamScores.length-1; i++

int i=0; i<teamScores.length; i++

Create a free account and access millions of resources

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?