AP CSA UNIT 3

AP CSA UNIT 3

10th Grade

26 Qs

quiz-placeholder

Similar activities

03 Text Adventure Worksheet

03 Text Adventure Worksheet

9th - 12th Grade

30 Qs

Array and ArrayLists in Java

Array and ArrayLists in Java

10th - 12th Grade

29 Qs

Unit 5 Quiz (Java)

Unit 5 Quiz (Java)

10th Grade

23 Qs

Algoritma dan Pemrogaman Dasar

Algoritma dan Pemrogaman Dasar

10th Grade - University

30 Qs

Arrays

Arrays

10th - 12th Grade

21 Qs

Java Basics Recap

Java Basics Recap

9th Grade - University

25 Qs

Penilaian Tengah Semester

Penilaian Tengah Semester

10th Grade

25 Qs

Ulangan Harian Informatika Kelas 11

Ulangan Harian Informatika Kelas 11

9th - 12th Grade

27 Qs

AP CSA UNIT 3

AP CSA UNIT 3

Assessment

Quiz

Computers

10th Grade

Hard

Created by

James Santiago

Used 2+ times

FREE Resource

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly accesses the last element of an array `arr` in Java?

`arr[arr.length]`

`arr[arr.length - 1]`

`arr[-1]`

`arr[length - 1]`

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the output of the following code? ```java int[] numbers = {2, 4, 6, 8, 10}; System.out.println(numbers[2]); ```

2

4

6

8

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop is best for iterating through an array when you don’t need to modify the elements?

`for` loop

`while` loop

Enhanced `for` loop

Do-while loop

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What does the following method return? ```java public int sumArray(int[] arr) { int sum = 0; for (int i = 0; i < arr.length; i++) { sum += arr[i]; } return sum; } ```

The product of all elements in the array

The sum of all elements in the array

The length of the array

The largest element in the array

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about polymorphism?

It allows a method to have multiple definitions with different parameter types.

It enables an object to take many forms and execute overridden methods of a subclass.

It ensures that an object’s data is private and can only be accessed through methods.

It allows a class to inherit methods and fields from another class.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when you compare two String objects using `==` instead of `.equals()`?

It compares the actual content of the strings.

It always returns `true`.

It compares the memory addresses of the objects.

It throws a runtime exception.

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

How many times will the following nested loop execute? ```java for (int i = 0; i < 3; i++) { for (int j = 0; j < 4; j++) { System.out.println("Hello"); } } ```

3

4

7

12

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?