Java Programming Concepts and Expressions

Java Programming Concepts and Expressions

Assessment

Flashcard

Computers

12th Grade

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

29 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following data types is used to store a whole number in Java? Options: double, int, boolean, String

Back

int

2.

FLASHCARD QUESTION

Front

Given int x = 7; int y = 3; double z = x / y;, what is the value of z after this code executes?

Back

2.0

3.

FLASHCARD QUESTION

Front

Which of the following best describes the purpose of a variable in a Java program? Options: To perform arithmetic calculations only, To store data values that can be used and modified later, To display values on the screen, To hold comments and documentation for the code

Back

To store data values that can be used and modified later

4.

FLASHCARD QUESTION

Front

What is the value of c after executing the following code:
int a = 10;
int b = 3;
int c = a % b;

Back

1

5.

FLASHCARD QUESTION

Front

Which of the following correctly represents a boolean value in Java? YES, True, true, 1

Back

true

6.

FLASHCARD QUESTION

Front

If int n = 5;, which expression correctly casts n to a double? Options: double x = n;, double x = (int)n;, double x = (n)double;, double x = (double)n;

Back

double x = (double)n;

7.

FLASHCARD QUESTION

Front

Which of the following is not a primitive data type in Java? Options: int, double, boolean, String

Back

String

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?