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.

21
Q

Single-precision floating point.

22
Q

Double-precision floating point.

23
Q

A single character.

24
Q

Can be true or false.

25
Uses naming rules for legal class identifiers; names must be legal Java identifiers; must start with a letter and cannot be a reserved keyword.
NAME VARIABLES
26
Begins with lowercase letters and capitalizing subsequent words.
CAMEL CASING
27
To use a variable, you must first D______ it
DECLARE
28
A statement that reserves a named memory location.
VARIABLE DECLARATION
29
It Includes data type, identifier, optional assignment operator, and assigned value, and ending semicolon For example, int age;
VARIABLE DECLARATION
30
The equal sign (=) The value to the right is assigned to the variable on the left For example, int age = 30;
ASSIGNMENT OPERATOR
31
int age = 30; is called?
DECLARATION AND INITIALIZATION
32
An assignment made when declaring a variable.
INITIALIZATION
33
A declared variable but do not assign a value to it. | For example, age = 30;
UNINITIALIZED VARIABLE
34
Should not change during program execution.
NAMED CONSTANT
35
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
NAMED CONSTANT
36
The area in which a data item is visible to a program, and in which you can refer to it using its simple identifier.
SCOPE
37
A ___________ is in scope from the point it is declared Until the end of the block of code where the declaration lies
VARIABLE OR CONSTANT
38
Use alone or in combination with a String.
print() or println() statement
39
A numeric variable is concatenated to a String using the plus sign.
CONCATENATED
40
``` The entire expression becomes a String The println() method can accept a number or String ```
CONCATENATED
41
Is a whole number without decimal places.
INTEGER / INT
42
This data type is based on true or false comparisons.
BOOLEAN
43
Compares two items; it is sometimes called a comparison operator.
RELATIONAL OPERATOR
44
A ___________ number contains decimal positions.
FLOATING POINT
45
Holds any single character. Place a constant character value within single quotation marks.
CHAR / CHAR DATA TYPE
46
``` A built-in class Stores and manipulates character strings. ```
STRING
47
Are written between double quotation marks.
STRING CONSTANTS
48
Begins with a backslash followed by a character.
ESCAPE SEQUENCE
49
Represents a single non-printing character
ESCAPE SEQUENCE