JavaP2 Unit 2 Data Structures Quiz

JavaP2 Unit 2 Data Structures Quiz

9th - 12th Grade

22 Qs

quiz-placeholder

Similar activities

Data Representation Quiz

Data Representation Quiz

9th Grade

20 Qs

Kuis PPJ - Konsep Routing Pada Jaringan

Kuis PPJ - Konsep Routing Pada Jaringan

11th Grade

20 Qs

Year 8 IT - Network Communication

Year 8 IT - Network Communication

7th - 9th Grade

20 Qs

Ôn tập học kỳ I

Ôn tập học kỳ I

9th - 12th Grade

20 Qs

Programming Vocabulary

Programming Vocabulary

10th - 12th Grade

17 Qs

Soal MID TKJ

Soal MID TKJ

12th Grade

20 Qs

A level Y12 Data Representation - Numbers SETS

A level Y12 Data Representation - Numbers SETS

11th Grade - University

18 Qs

JavaP2 Unit 2 Data Structures Quiz

JavaP2 Unit 2 Data Structures Quiz

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Krista Dobbins

Used 17+ times

FREE Resource

AI

Enhance your content

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

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following arrays has a length of 5?

double[] arr = new double[6];

double[] arr = {0, 1, 2, 3, 4, 5};

double[] arr = new double[]{1, 2.3, 4, 5};

None of the above

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Which of the following are valid arrays?

I only

II only

III only

I and II

I and III

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What is the output of the following program?

hel

hello

hellow

Error

None of the above

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

When run, which of the following yields the integer 5?

int[] newArray = {5, 5, 5, 5, 5, 5};

System.out.println(newArray.length);

String pets[] = new String[5];

System.out.println(pets.length());

int[] anotherArray = {5, 10, 15, 20, 25};

System.out.println(anotherArray[(anotherArray.length - 2)] - 15);

String[] favoriteNumbers = {"5", "7", "12", "13", "5"};

System.out.println(favoriteNumbers[favoriteNumbers[0]]);

int[] greatArray = {5, 4, 3, 2, 1, 0};

System.out.println(greatArray.get(0));

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What values will the array contain after the following the code is run?

{6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4}

{1, -3, 3, -1, 5, 1, 7, 3, 9, 5, 11}

{1, 3, 5, 7, 9, 7, 5, 3, 1, -1, -3}

{-4, 1, -2, 3, -4, 5, -6, 7, -8, 9}

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

You are working at the frozen yogurt shop in the mall. Your boss asks you to count how many flavors have the word chocolate in their name. You begin going through the list of flavors, but quickly realize that their are over 9000 flavors to check! Luckily, your boss stored all of the different flavors in a Java Array named flavorArray on the company computer. Write a Java program to count the number of flavors that have chocolate in their name.

Media Image
Media Image
Media Image
Media Image

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

What value will be held in mysteryNumber when this code finishes running?

0

17

1

16

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?