2.4_Understanding Data Types Flashcards

1
Q

What are the two types categories of data in Java?

A

Primitive Types and Reference Types.

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

How many built-in data types Java has?

A

Java has eight built-in data types, referred to as the Java primitive types.

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

Which are the built-in data (primitive) types?

A

char | 16-bit Unicode value | ‘a’ | 0 to 65535
byte | 8-bit integral value | 123 | -128 to 127
short | 16-bit integral value | 25500 | -32768 to 32767
int | 32-bit integral value | 123 | -2,147,483,648 to 2,147,483,647
float |
long |

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

Is String a Primitive?

A

No, it is not. String is often mistaken for a ninth primitive because Java includes built-in support for String literals and operators.

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

Can reference types be assigned null?

A

Yes, which means they do not currently refer to an object.

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

Can primitive types be assigned null?

A

No, If you attempt to assign them null value, compiler will give you an error.

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

Which Data Type can call methods (Primitives | Reference)?

A

✅We can call a method on reference since it is of a reference type.
❌Primitives do not have methods.

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

Type names

A

Primitive types have lowercase type names.

All classes that come with Java begin with uppercase.

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