APCSA Arrays

APCSA Arrays

9th - 12th Grade

20 Qs

quiz-placeholder

Similar activities

การเขียนโปรแกรม

การเขียนโปรแกรม

10th - 11th Grade

20 Qs

حاسب 1 نظري

حاسب 1 نظري

10th Grade

21 Qs

PPG 25 Feb 2022

PPG 25 Feb 2022

12th Grade

19 Qs

Memahami PBO

Memahami PBO

11th Grade - University

15 Qs

Quiz sobre Estructuras Selectivas en Java

Quiz sobre Estructuras Selectivas en Java

12th Grade - University

19 Qs

INFORMATIKA X A-B

INFORMATIKA X A-B

10th Grade

20 Qs

ความรู้เบื้องต้นการเขียนโปรแกรมภาษาซี

ความรู้เบื้องต้นการเขียนโปรแกรมภาษาซี

12th Grade

20 Qs

Kisi - Kisi

Kisi - Kisi

11th Grade

20 Qs

APCSA Arrays

APCSA Arrays

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Jennifer Hoagland

Used 119+ 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 is FALSE about arrays on Java

A java array is always an object

Length of array can be changed after creation of array

Arrays in Java are always initialized to have values of 0

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Find the output

class Test {

public static void main(String args[]) {

int arr[2];

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

System.out.println(arr[1]);

}

}

Compile error

Exception

Garbage Value

Garbage Value

0

0

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Find the output

class Test {

public static void main(String args[]) {

int [ ] arr = new int[2];

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

System.out.println(arr[1]);

}

}

Compile error

Exception

Garbage Value

Garbage Value

0

0

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Output of following Java program?

class Test{

public static void main (String[] args) {

int [] arr1 = {1, 2, 3};

int [] arr2 = {1, 2, 3};

if (arr1 == arr2)

System.out.println("Same");

else

System.out.println("Not same");

}}

Same

Not same

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

class Test{

public static void main (String[] args) {

int [] arr1= {1, 2, 3};

int [] arr2 = {1, 2, 3};

if(arr1.equals(arr2))

System.out.println("Same");

else

System.out.println("Not same");

}}

Same

Not same

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the length of the following array: int [] data = { 12, 34, 9, 0, -62, 88 };

1

5

6

12

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Does a programmer always know how long an array will be when the program is being written?

Yes---the program will not compile without the length being declared.

No---the array object is created when the program is running, and the length might change from run to run.

Yes---otherwise the program will not run correctly.

No---arrays can grow to whatever length is needed.

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?

Discover more resources for Computers