Data types Flashcards

(42 cards)

1
Q

It describes the possible operations on the data and the storage method.

A

Data types

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

(Agarwal & Bansal, 2023)
_______ are built into the Java language. These are data that are not objects and have no
methods. The Java compiler has detailed instructions on the valid operations this data type supports.

A

Primative Datatypes

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

are built into the Java language. These are data that are not objects and have no
methods.

A

Primitive Data Types

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

The name will be stored as characters, the age
will be stored as a numeric value, and the address will be stored as an alphanumeric value, what is this? .

A

Data Types

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

Recite the 8) Primitive types that Java defines.

A

•Byte
•Short
•Int
•Long
•Float
•Double
•Char
•Boolean

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

what is the bit size of Byte?

A

8

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

what is the bit size of Short?

A

16

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

what is the bit size of int?

A

32

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

what is the bit size of Long?

A

64

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

what is the bit size of Float?

A

32

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

what is the bit size of double?

A

64

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

what is the bit size of char ?

A

8

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

what is the bit size of boolean?

A

1

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

Java defines Byte, Short, Int, and Long as?

A

Integer Data Types

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

It defines the sign of an integer
value, and Java manages it differently by adding a special “unsigned right shift” operation.

A

High-order bit

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

The smallest integer type that represents a small number.

A

Byte

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

An integer is considered _____ if its value is between -32768 and 32767. This data type
declare a variable that can hold numbers in that range.

18
Q

A hexadecimal number can also be initialized as a Short variable instead of a normal decimal integer.
So, the 3001 integer can be written as

19
Q

This data type can handle larger numbers and is considered the best choice when an integer is
needed because when Byte and Short values are used in an expression, they are promoted to ___
automatically.

20
Q

This data type holds a number higher than a regular integer. The ____ integer is a variable that
can hold a very large number. A capital letter ‘L’ is placed right after the value.

21
Q

Floating Point Types are used when evaluating an expression that needs
fractional accuracy such as the computation of square root or a transcendental (sine and cosine).What are these?

A

•float
•double

22
Q

A real number qualifies as a single precession
when it only needs a limited number of bits. Single precision takes half the space of a double
precision and is much faster on some processors. What data type is this?

24
Q

_____ precision can be faster than single precision on modern processors that have been
optimized for high-speed mathematical calculations. It can handle larger numbers than Float.

25
Character types can be divided into two (2):
(a) A Byte for a character (ASCII) and (b) a type in itself (Unicode)
26
a code that assigns numbers to letters, digits, etc.) number.
ASCII ( American Standard Code for Information Interchange )
27
To support characters that are not traditionally used in (US) English and do not work with compilers, the ____ character format was created which includes Latin-based and non-Latin-based languages.
Unicode
28
It allows Byte data types to be used to declare a variable that would hold a single character to initialize such variable or assign a single quoted character.
ASCII ( American Standar Code for Information Interchange )
29
This data type is used for logical values and can only hold true or false values. It is a type returned by all relational operators such as =, >, and <.
boolean
30
____ is an abstract data type that can store letters, digits, and other characters such as a slash (/), comma (,), parentheses (()), semi- colon (;), dollar sign ($), and a hashtag (#).
String
31
These are based on primitive data types but with more functionality.
Abstract Data Types
32
As mentioned, all variables in Java must be declared first before they can be used. The basic format of a variable declaration is as follows:
Data Type identifier [= value] [, identier] [= value];
33
______ are true or false and cannot use numbers to represent them.
Boolean Literals
34
are numeric data that can be represented as octal, hexadecimal, and binary literals.
Integer Literals
35
____ is the number with a zero prefixed.
Octal
36
____ is the number prefixed with 0x.
Hexadecimal
37
is the number that starts with 0B or 0b. An underscore (_) can be used to improve the readability of the numeric data.
Binary Literal
38
_____ are numbers that have a decimal fraction. A suffix letter F (lower or uppercase) to the number; otherwise, the compiler will flag about loss of precision.
Floating Point Literals
39
must also be enclosed in single quotes (‘,’). The Unicode value of the character is also allowed.
Character Literals
40
are enclosed in double quotes (","). Strings are included as literal as they can still be typed directly into the code, even though it is not a primitive type.
String Literals
41
Recite the rules for naming variables.
The name of a variable must be meaningful, short, and without any embedded space or symbol like ?, !, @, #, %, ^, &, ( ), [, ], {, }, ., 1, “c/, and \. However, underscores (_) can be used wherever a space is required. For example, monthly_Salary. • Variable names must be unique. For example, to store five (5) different numbers, five (5) unique variable names need to be used for each. • A variable name must begin with a letter, a dollar sign, or an underscore, which may be followed by a sequence of letters (any case) or digits (0-9), `$’, or an underscore. • Keywords cannot be used for variable names. For example, a variable called “switch” cannot be declared
42
Recite the Java variable naming conventions.
Variable names should be meaningful. • The names must reflect the data that the variables contain. To store the gender of an employee, the variable name could be emp_gender. • Variable names are nouns and must begin with a lowercase letter. • If a variable name contains two or more words, begin each word with an uppercase letter. However, the first word will start with a lowercase letter.