Declaring and using constants and variable Flashcards

1
Q

when the value of data item cannot be changed while running a program.

A

Constant

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

___ can be refer as literal constant, numeric constant, unnamed constant or simply, hard-coded.

A

459

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

a named memory location that can store a value. It can only hold one value but the value it hold can be changed.

A

Variable

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

describes the type of data that can be stored, how much memory the item occupies and types of operation that can be perform on the data.

A

Data type

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

– is a statement that reserves a named memory location

A

Variable declaration

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

A ______ that identifies the type of data that the variable will store

A

data type

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

An _____ that is the variable’s name

A

identifier

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

begins with lowercase letter and capitalizing subsequent words within the identifier

A

Camel Casing

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

An __________ , if you want a variable to contain an initial value

A

optional assignment operator (=) and assigned value

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

contains unknown value (garbage value)

A

Uninitialized variable –

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

– to declare 2 or more variables of the same type in a single statement, it is separated by a comma.

A

Multiple variable declaration

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

the value of the location should not be changed during execution.

A

Named Constant

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

All of integer data type are signed

A

(+ or -)

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

Declaring integer data type:

A
  • int (variable)
  • byte (variable)
  • short (variable)
  • long (variable)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

BOOLEAN DATA TYPE

A

Only has 2 values (true or false)

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

use to compare two items.
- also called “comparison operators”

A

Relational operator –

16
Q

Two floating-point data types

A

Two floating-point data types

16
Q

number contains decimal.

A

Floating-point –

17
Q
  1. float
  2. double
A

– data type that can hold values up to 6 or 7 significant accuracy
– data type that can hold values up to 14 or 15 significant accuracy

18
Q

data type to hold single character.

A

char

19
Q

– built-in class that provides the means for storing and manipulating character strings.

A

String

20
Q

special characters that begins with a backslash.

A

Escape Sequence

21
Q

is used for obtaining the input of the primitive data type.

A

Scanner –

22
Q

– retrieved value from an input device.

A

Token

23
Q
  • Java supports two types of division
A

Floating-point division
Integer division

24
Q

Floating-point division
Integer divisiom

A

– occurs when either or both operands are
floating-point values. Example: 45.0 / 2 = 22.5
– occurs when both operand are integers.
Example: 45 / 2 = 22

25
Q

is the remainder operator
- it results the remainder of two integers.

A

Percent sign (%) or Modulo –

26
Q

is the process of converting one data type to another.

A

Type conversion –

27
Q

it automatically converts nonconforming operands to the unifying type. It is also called Promotions.

A

In implicit conversion

28
Q

is the type to which all operands in an expression are converted so that they are compatible to each other

A

Unifying type

29
Q

is the overriding the unifying type.

A

Explicit Conversion –

30
Q

forces the value of one data type to be used as a value of another data type

A

Type Casting

31
Q

– is created by placing the desired result type in parenthesis.

A

Cast Operator