AP Computer Science-Quiz 2(G10)

AP Computer Science-Quiz 2(G10)

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Java while loops

Java while loops

10th - 12th Grade

6 Qs

Python Basics Quiz

Python Basics Quiz

9th Grade

15 Qs

Programación

Programación

12th Grade

12 Qs

Unit 6 Arrays

Unit 6 Arrays

10th - 12th Grade

14 Qs

Informática 10-B (IV-Per)

Informática 10-B (IV-Per)

10th Grade

10 Qs

CodeHS 2.6 Booleans

CodeHS 2.6 Booleans

9th Grade

10 Qs

JavaScript Quiz

JavaScript Quiz

9th Grade

15 Qs

Random Number Generation in Java

Random Number Generation in Java

12th Grade

13 Qs

AP Computer Science-Quiz 2(G10)

AP Computer Science-Quiz 2(G10)

Assessment

Quiz

Computers

9th - 12th Grade

Easy

Created by

fareeda k

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

1. In Java, which keyword is used to declare an integer variable?

 

int

double

char

boolean

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. What is the output of the following code snippet?

             int num = 10;

             num = num + 5;

             System.out.println(num);

5

10

15

20

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. 3. Primitive data types in Java include int, double, char, and boolean.

True

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. 4. Which operator is used to compare if two values are not equal in Java?

==

!=

>

 <

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. 5. What is the correct syntax for an if statement in Java?

`if condition { }`

`if (condition) { }`

`if (condition); { }`

`if {condition} ( )`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. Which of the following is a logical operator in Java?

&&

!=

==

>

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. An if-else statement can be used to execute one block of code if a condition is true and another block of code if the condition is false.

True

False

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?