Java - Variables and Expressions Practice

Java - Variables and Expressions Practice

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

AP Computer Science A Quiz

AP Computer Science A Quiz

12th Grade

15 Qs

Latihan UPS2

Latihan UPS2

5th - 12th Grade

15 Qs

Variables & Data Types

Variables & Data Types

6th - 12th Grade

10 Qs

Variables and their Data Types in JAVA

Variables and their Data Types in JAVA

9th Grade

8 Qs

CodeHS Lessons 2.1 - 2.5

CodeHS Lessons 2.1 - 2.5

8th - 12th Grade

11 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

Java

Java

11th Grade

10 Qs

Java Quiz 1: Introduction

Java Quiz 1: Introduction

6th - 12th Grade

10 Qs

Java - Variables and Expressions Practice

Java - Variables and Expressions Practice

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Jessica Guthrie

Used 7+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid Java variable name?

10thousand

_squareValue

$earned

amount_remaining

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You need three things to declare a variable in Java.

The datatype, ; at the end, and...

the variable name

an equal sign

//at the beginning

the variable size

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following lines of code correctly declares a variable with a proper Java variable name?

boolean isOff;

Int size;

double $saved;

string FirstName;

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following lines of code correctly declares AND initializes a variable with an appropriate value?

boolean isOff = yes;

int size = 500.8;

double saved$ = 400.0;

String firstName = Tuna;

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When dividing two ints in Java, the answer will be an int.

For example: 10/3 = 3

TRUE

FALSE

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Evaluate the expression below.

2 + 6 * 4 - 5

21

27

-4

-8

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Evaluate the expression below.

(4 + 3) * 2 - (19 / 5)

11

10.2

-7

25

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?