

Data Types & Variables Review
Presentation
•
Computers
•
12th Grade
•
Practice Problem
•
Easy
Nichole Niebur
Used 5+ times
FREE Resource
10 Slides • 8 Questions
1
Data Types and Variables Review
2
Data types can be categorized as either primitive or reference
Primitive
Reference
3
Labelling
Label the following Data Types
(I know some can be "right" but it will make it wrong because it's a computer program, try to think of size order to help.)
4
Variables
A variable is a piece of the computer's memory that is given a name and a type, and can store a value.
5
State its name and type
Declare It
Store a value into it
Initialize It
Print it or use it as part of an expression.
Use It
Steps for using a variable
6
Set aside memory for storing a value.
! Variables must be declared before they can be used
Syntax = type <name>;
*The name is an identifier
Declaration
7
Multiple Choice
Which of the following properly DECLARES a variable?
int x = 5
byte y
myGPA;
float myGPA;
8
Storing a value into a variable
! can be done in one step OR separately
Syntax = name = expression;
int x; or int x = 3;
x = 3;
Assignment
9
Multiple Choice
Which of the following properly ASSIGNS a variable?
x = 5
byte y = 2
myGPA = 4.0;
float myGPA = 4.0
10
Once given a value, a variable can be used in expressions
System.out.println("x is " + x);
! you can assign a value more than once
int x = 3; //here x is 3
x = 4 + 7; //now x is 11
Using Variables
11
=
This is the assignment operator!
It does not mean equals, instead it means "stores the value of "
NOT EQUALS!
12
Fill in the Blanks
13
Multiple Variables
Multiple variables of the same type can be declared and initialized at the same time.
Syntax:
int x, y, z; //declares three integers
int a = 1, b = 2, c = 3; //declare and initialize three
// integers
14
double myGPA = 4;
hmmm... can you guess what's coming?
An int value can be stored in a double variable, but the value is converted to the equivalent type.
int x = 2.5; //ERROR
incompatible types
A variable can only store a value of its own type.
Assignment and Types
15
Math Response
What does this program print?
double myGPA = 4;
System.out.println(myGPA);
16
Poll
Does this cause an error?
int x;
7 = x;
Yes
No
17
Poll
Does this cause an error?
int x;
System.out.println(x);
Yes
No
18
Poll
Does this cause an error?
int x;
int x = 3;
Yes
No
Data Types and Variables Review
Show answer
Auto Play
Slide 1 / 18
SLIDE
Similar Resources on Wayground
11 questions
Ancho de banda
Presentation
•
12th Grade
12 questions
Aplikasi Pengolah Angka/ Spreadsheet
Presentation
•
12th Grade
14 questions
SISTEMA
Presentation
•
12th Grade
14 questions
JARINGAN KOMPUTER
Presentation
•
12th Grade
15 questions
Computers and Devices
Presentation
•
KG - University
13 questions
Función inversa
Presentation
•
12th Grade
14 questions
CAPTION TEXT
Presentation
•
12th Grade
11 questions
Algebra - Lesson Negative Exponents
Presentation
•
12th Grade
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Assessment 2
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
12 questions
2026 TAP Technology in the Classroom
Presentation
•
Professional Development
15 questions
HCS SCI 05 Summer School Assessment 2 Review
Quiz
•
5th Grade
15 questions
HCS SCI 04 Summer School Review 2
Quiz
•
4th Grade
59 questions
Geometry Unit 3 Review
Quiz
•
9th - 12th Grade
14 questions
FAST ELA READING SMAPLE TEST MATERIALS
Passage
•
3rd Grade