AP Computer Science-Quiz 2(G10)

AP Computer Science-Quiz 2(G10)

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

loops

loops

9th - 10th Grade

6 Qs

Unit 6

Unit 6

12th Grade

10 Qs

Class 9 Conditional Statement

Class 9 Conditional Statement

9th Grade

10 Qs

Java Arrays Basic

Java Arrays Basic

10th - 12th Grade

15 Qs

For Loops HW

For Loops HW

9th - 12th Grade

12 Qs

Java Level 1 - D

Java Level 1 - D

12th Grade

15 Qs

Java Scanner Quiz

Java Scanner Quiz

11th Grade

15 Qs

002_Java Methods

002_Java Methods

12th Grade - University

15 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?