Home
Explore
Exams
Search for anything
Login
Get started
Home
Primitive Types
Primitive Types
0.0
(0)
Rate it
Studied by 1 person
0.0
(0)
Rate it
Call Kai
Learn
Practice Test
Spaced Repetition
Match
Flashcards
Knowt Play
Card Sorting
1/4
There's no tags or description
Looks like no tags are added yet.
Study Analytics
All Modes
Learn
Practice Test
Matching
Spaced Repetition
Name
Mastery
Learn
Test
Matching
Spaced
No study sessions yet.
5 Terms
View all (5)
Star these 5
1
New cards
What is widening or automatic type conversion? (up casting) What is narrowing or explicit conversion? (down casting) During expressions?
This means you can convert from smaller data types to larger ones. It’s automatic because it can easily fit in the data type.
\
Ex. int y = 5;
double x = y; (X is bigger than y)
\
Downcasting means you convert larger data types to smaller ones. It’s explicit because you must be able to fit a larger one into a smaller one.
Ex. double x = 15432432;
int y = (int) x; (you must shrink x to fit into y)
\
Sometimes, an expression will result in a number larger than the data type can sustain. You will need to typecast it then
` // Declaring byte array`
` byte` `b = 50;`
` // Type casting int to byte`
` b = (byte)(b * 2);`
\
2
New cards
What is type promotion and why is it important?
It’s when a data type is unable to perform an operation in it’s current so it must promote itself to a different type to perform it.
\
Java automatically promotes each byte, short, or char operand to int when evaluating an expression.
3
New cards
How do you convert from binary to hexadecimal?
Split up the binary number into sets of 4 and write it that way.
\
You can also convert each letter in hexadecimal to binary by converting each letter in hexadecimal to a set of 4 binary number and combining it.
4
New cards
What is a final
A variable that won’t change.
5
New cards
Explore top notes
Chapter 37: Domestic Poisons
Updated 940d ago
Note
Preview
AP Precalculus - Unit 1: Polynomial and Rational Functions Flashcards
Updated 536d ago
Note
Preview
Nucleus
Updated 1049d ago
Note
Preview
Chapter 6: Electronic Structure of Atoms
Updated 334d ago
Note
Preview
1. The Qing Dynasty (1644-1911)
Updated 711d ago
Note
Preview
AP Art History: 1.02 The Analysis of Art
Updated 1207d ago
Note
Preview
AP World Unit 8 Cramming Notes
Updated 60d ago
Note
Preview
Tilknytning, trygghet og tillit
Updated 1005d ago
Note
Preview
Chapter 37: Domestic Poisons
Updated 940d ago
Note
Preview
AP Precalculus - Unit 1: Polynomial and Rational Functions Flashcards
Updated 536d ago
Note
Preview
Nucleus
Updated 1049d ago
Note
Preview
Chapter 6: Electronic Structure of Atoms
Updated 334d ago
Note
Preview
1. The Qing Dynasty (1644-1911)
Updated 711d ago
Note
Preview
AP Art History: 1.02 The Analysis of Art
Updated 1207d ago
Note
Preview
AP World Unit 8 Cramming Notes
Updated 60d ago
Note
Preview
Tilknytning, trygghet og tillit
Updated 1005d ago
Note
Preview
Explore top flashcards
Sadlier Vocab Level D unit 9
Updated 228d ago
Flashcards (20)
Preview
Psychology Unit 1 Module 2
Updated 785d ago
Flashcards (23)
Preview
IPA Symbols
Updated 745d ago
Flashcards (48)
Preview
CISC vs RISC
Updated 701d ago
Flashcards (22)
Preview
collocation 12
Updated 254d ago
Flashcards (67)
Preview
3/22/24 - DNA exam
Updated 591d ago
Flashcards (25)
Preview
Ultimate AP Vocab - Flashcards
Updated 185d ago
Flashcards (284)
Preview
SCMA 350 Exam 1
Updated 974d ago
Flashcards (37)
Preview
Sadlier Vocab Level D unit 9
Updated 228d ago
Flashcards (20)
Preview
Psychology Unit 1 Module 2
Updated 785d ago
Flashcards (23)
Preview
IPA Symbols
Updated 745d ago
Flashcards (48)
Preview
CISC vs RISC
Updated 701d ago
Flashcards (22)
Preview
collocation 12
Updated 254d ago
Flashcards (67)
Preview
3/22/24 - DNA exam
Updated 591d ago
Flashcards (25)
Preview
Ultimate AP Vocab - Flashcards
Updated 185d ago
Flashcards (284)
Preview
SCMA 350 Exam 1
Updated 974d ago
Flashcards (37)
Preview