Java Lesson 4 - Data and Variables
Java Lesson 4 - Data and Variables
ROWELL L. MARQUINA
Senior High School Teacher
TUNASAN NATIONAL HIGH SCHOOL
LEARNING OBJECTIVES:
At the end of the session, you will be able to:
1. define data and data type;
2. categorize data according to
classifications;
3. discuss what is a variable and its
importance; and
4. declare and initialize variables and
use it in a Java program.
WHAT IS DATA?
Data in programming refers
to information can be stored,
processed, and generated by
a computer system.
It is characterized by its
capacity to:
▪ be transformed to other
type of information
▪ to be transmitted to other
computer systems.
IMAGE SOURCE:
https://images.datacamp.com/image/upload/v1652357545/shutterstock_1770654182_d43667c1bc.jpg
WHAT IS DATA?
Examples of Data:
▪ Name
▪ Date of Birth
▪ Sex/Gender
▪ Address
▪ Cell Phone Number
▪ Serial Number
▪ Email Address
▪ String of Letters or Numbers
▪ A Yes/No Answer
IMAGE SOURCE:
https://images.datacamp.com/image/upload/v1652357545/shutterstock_1770654182_d43667c1bc.jpg
WHAT IS DATA?
When a data is inputted in
computer system for processing, it
will be entered in the system’s
memory unit for either temporary
or permanent storage.
Depending on its size and data
type, it will be assigned to occupy a
specific space in the storage unit
which are identified using memory
address.
refers to the data type that can only store any of the two reserved
boolean
values of either true or false.
WHAT IS A VARIABLE?
A variable is a name or label
assigned by a programmer for a
data container located in the
memory unit.
Using variable enables programmers
to label a memory allocation with a
more readable and recognizable
name rather than its actual memory
address for easier referencing.
Email Address:
[email protected]
[email protected]
[email protected]