Save
Java-Primitive Types
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Faaiq Usman
Visit profile
Cards (22)
What types have been covered so far in the course?
Primitive
types
View source
What are the primitive types in Java?
Numeric
(integer, floating-point, char, Boolean)
View source
What are non-primitive types also known as?
Composite
types
View source
What are the non-primitive types in Java?
Strings
Arrays
Objects
View source
What are the properties of primitive types?
They are built into the
language
, cannot be
decomposed
, and are not
classes.
View source
How do variables of primitive types store values?
They hold the
actual
value, not a
reference.
View source
What are the properties of non-primitive types?
They are not always built into the
language
, can be
decomposed
, and are
classes.
View source
How do variables of non-primitive types store values?
They hold a
reference
to the value, not the
actual
value.
View source
What is an array in Java?
A collection of
elements
of the same
type.
View source
How is a String in Java defined?
A String is made up of a sequence of
characters.
View source
How is the state represented in objects?
State
is represented as
fields.
View source
What is the difference in how primitive and non-primitive types store values?
Primitive types store
actual
values, while non-primitive types store
references
to values.
View source
How do you compare primitive types in Java?
Using "
==
" and "!=" to compare values.
View source
How do you compare non-primitive types in Java?
Using "
==
" and "!=" compares memory locations, while values are compared using
type-specific
methods.
View source
What will be printed if
a
=
a =
a
=
5.5
5.5
5.5
and
b
=
b =
b
=
5.5
5.5
5.5
are compared with "
==
"?
Equal with ==
View source
What will be printed if two String objects are compared with "
==
"?
Equal with
==
View source
What will be printed if two arrays are compared with "
==
"?
Equal with
==
View source
What happens to the parameter value when it is changed inside a method?
Changing the value of a
parameter
inside the method doesn’t change its value
externally.
View source
Can you change the memory location of a non-primitive type parameter inside a method?
No
, you can’t change the memory location, but you can change the
contents
of that location.
View source
What will happen to the array 'numbers' after calling
d
o
S
o
m
e
t
h
i
n
g
(
n
u
m
b
e
r
s
)
doSomething(numbers)
d
o
S
o
m
e
t
hin
g
(
n
u
mb
ers
)
?
The array 'numbers' will remain
unchanged.
View source
What will happen to the array 'numbers' after calling
d
o
S
o
m
e
t
h
i
n
g
E
l
s
e
(
n
u
m
b
e
r
s
)
doSomethingElse(numbers)
d
o
S
o
m
e
t
hin
g
El
se
(
n
u
mb
ers
)
?
The
second
element of 'numbers' will be changed to
5.
View source
What are the key differences between primitive and non-primitive types in Java?
Primitive types:
Store
actual
values
Built into the
language
Cannot be
decomposed
Not a
class
Non-primitive types:
Store
references
to values
Not always built into the
language
Can be
decomposed
Are
classes
View source
See similar decks
Unit 1: Primitive Types
AP Computer Science A
160 cards
1.1 Variables and Data Types
AP Computer Science A > Unit 1: Primitive Types
45 cards
1.2 Arithmetic Expressions
AP Computer Science A > Unit 1: Primitive Types
56 cards
1.3 Casting and Ranges of Variables
AP Computer Science A > Unit 1: Primitive Types
59 cards
1.4.1 Data types
OCR A-Level Computer Science > 1.4 Data types, data structures and algorithms
94 cards
1.1.9 Muscle contraction types
AQA GCSE Physical Education > 1. Applied anatomy and physiology > 1.1 The structure and functions of the musculoskeletal system
99 cards
5.3.1 Types of guidance
GCSE Physical Education > 5. Sports psychology > 5.3 Mental preparation
73 cards
6.1.1 Types of Pathogens
Edexcel A-Level Biology > Topic 6: Immunity, Infection and Forensics > 6.1 Pathogens and Disease
123 cards
4.2.2 Types of Unemployment
Edexcel GCSE Economics > 4. Macroeconomics > 4.2 Unemployment
11 cards
6.3.1 Types of Immunity
Edexcel A-Level Biology > Topic 6: Immunity, Infection and Forensics > 6.3 Vaccination and Immunity
33 cards
2.3.2 Types of Radiation
WJEC GCSE Physics > Unit 2: Forces, Space, and Radioactivity > 2.3 Radioactivity
70 cards
6.2 Types of Radiation
Edexcel GCSE Physics > Topic 6: Radioactivity
52 cards
1.1.9 Muscle contraction types
GCSE Physical Education > 1. Applied anatomy and physiology > 1.1 The structure and functions of the musculoskeletal system
32 cards
4.2.1 Types of Waste
AQA A-Level Environmental Science > 4. Pollution > 4.2 Waste Management
45 cards
3.3.16.2 Types of Chromatography
AQA A-Level Chemistry > 3.3 Organic Chemistry > 3.3.16 Chromatography (A-level only)
40 cards
3.1 Types of Energy
AQA A-Level Environmental Science > 3. Energy Resources
155 cards
4.1 Types of Pollution
AQA A-Level Environmental Science > 4. Pollution
129 cards
5.3.2 Types of feedback
AQA GCSE Physical Education > 5. Sports psychology > 5.3 Mental preparation
41 cards
9.3.1 Types of Catalysts
Edexcel A-Level Chemistry > Topic 9: Kinetics I > 9.3 Catalysis
70 cards
13.4.1 Types of testing
AQA A-Level Computer Science > 13.0 Systematic approach to problem solving > 13.4 Testing
23 cards
Types of training
Edexcel GCSE Business Studies > 2.5 Making Human Resource Decisions > 2.5.4 Training
161 cards