AP Computer Science-Quiz 2(G10)

AP Computer Science-Quiz 2(G10)

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Java Boolean Statements

Java Boolean Statements

11th Grade

11 Qs

JavaScript Control Structures Basic

JavaScript Control Structures Basic

12th Grade

11 Qs

Java

Java

11th Grade

10 Qs

Quiz 2 Java

Quiz 2 Java

11th Grade

15 Qs

Java Level 1 - B

Java Level 1 - B

12th Grade

15 Qs

Arrays

Arrays

10th - 12th Grade

10 Qs

REVIEW QUIZ FOR & WHILE LOOP

REVIEW QUIZ FOR & WHILE LOOP

10th Grade

10 Qs

operators(part-2_26/07)

operators(part-2_26/07)

9th Grade

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