Module 2 Flashcards

This module will teach you how to program using different data types and keyboard inputs. Specifically, Declare and use constants and variables Use integer data types Use the boolean data type Use floating-point data types Use the char data type Use the Scanner class to accept keyboard input

1
Q

Cannot be changed while the program is running

For example, System.out.println(459);

A

CONSTANT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The value that is taken literally at each use.

A

LITERAL CONSTANT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

As opposed to a literal constant.

A

NUMERIC CONSTANT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

No identifier is associated with it.

A

UNNAMED CONSTANT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Instead of using constant data, you can set up a data item to be _________.

A

VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A named memory location.

A

VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Used to store a value.

A

VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can hold only one value at a time.

A

VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Its value can change.

A

VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A type of data that can be stored.

A

DATA TYPE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

It refers to how much memory an item occupies.

A

DATA TYPE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A Data item’s _________ defines the type of data that can be stored there, how much memory the item occupies, and what types of operations can be performed on the data.

A

DATA TYPE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

2 Main Data Types in Java

A
  1. PRIMITIVE TYPES

2. REFERENCE OR CLASSES TYPES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

8 Primitive Data Types in Java

A
  1. BYTE
  2. SHORT
  3. INT
  4. LONG
  5. FLOAT
  6. DOUBLE
  7. CHAR
  8. BOOLEAN
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Are data types considered basic to Java.

A

PRIMITIVE TYPES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Are more complex data types which hold memory addresses.

A

REFERENCE OR CLASSES TYPE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

The keyword for a byte-length integer.

A

BYTE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The keyword for a short integer.

A

SHORT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

The keyword for integer.

A

INT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The keyword for long integer.

A

LONG

21
Q

Single-precision floating point.

A

FLOAT

22
Q

Double-precision floating point.

A

DOUBLE

23
Q

A single character.

A

CHAR

24
Q

Can be true or false.

A

BOOLEAN

25
Q

Uses naming rules for legal class identifiers; names must be legal Java identifiers; must start with a letter and cannot be a reserved keyword.

A

NAME VARIABLES

26
Q

Begins with lowercase letters and capitalizing subsequent words.

A

CAMEL CASING

27
Q

To use a variable, you must first D______ it

A

DECLARE

28
Q

A statement that reserves a named memory location.

A

VARIABLE DECLARATION

29
Q

It Includes data type, identifier, optional assignment operator, and assigned value, and ending semicolon
For example, int age;

A

VARIABLE DECLARATION

30
Q

The equal sign (=)
The value to the right is assigned to the variable on the left
For example, int age = 30;

A

ASSIGNMENT OPERATOR

31
Q

int age = 30; is called?

A

DECLARATION AND INITIALIZATION

32
Q

An assignment made when declaring a variable.

A

INITIALIZATION

33
Q

A declared variable but do not assign a value to it.

For example, age = 30;

A

UNINITIALIZED VARIABLE

34
Q

Should not change during program execution.

A

NAMED CONSTANT

35
Q

Has a data type, name, and value
Has a data type preceded by the keyword final
Can be assigned a value only once
Conventionally is given identifiers using all uppercase letters

A

NAMED CONSTANT

36
Q

The area in which a data item is visible to a program, and in which you can refer to it using its simple identifier.

A

SCOPE

37
Q

A ___________ is in scope from the point it is declared Until the end of the block of code where the declaration lies

A

VARIABLE OR CONSTANT

38
Q

Use alone or in combination with a String.

A

print() or println() statement

39
Q

A numeric variable is concatenated to a String using the plus sign.

A

CONCATENATED

40
Q
The entire expression becomes a String
The println() method can accept a number or String
A

CONCATENATED

41
Q

Is a whole number without decimal places.

A

INTEGER / INT

42
Q

This data type is based on true or false comparisons.

A

BOOLEAN

43
Q

Compares two items; it is sometimes called a comparison operator.

A

RELATIONAL OPERATOR

44
Q

A ___________ number contains decimal positions.

A

FLOATING POINT

45
Q

Holds any single character. Place a constant character value within single quotation marks.

A

CHAR / CHAR DATA TYPE

46
Q
A built-in class
Stores and manipulates character strings.
A

STRING

47
Q

Are written between double quotation marks.

A

STRING CONSTANTS

48
Q

Begins with a backslash followed by a character.

A

ESCAPE SEQUENCE

49
Q

Represents a single non-printing character

A

ESCAPE SEQUENCE