Java Literals PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Teacher

Aimee Joy
Prayer
Who is
here
today?
M 1.You will be group into two groups
E 2. The game will start with all the
cards face down and each of you
G C will take turns to turn over the

A H cards.

A 3. If the two cards have the same


M picture then they keep the cards
N otherwise they turn the cards face
E I
down again.

4. The first group with the most


C cards within 10 minutes will be the
winner.
S
Integer literals are whole numbers
without fractional or decimal
component these can be expressed
with the 4 data types the int, long,
byte and short.
Byte consist of 1 byte that stores whole numbers
from -128 to 127

Short- it consist of 2 bytes that stores -32,768 to


32,767

Int – 4 bytes consist of -2,147,483,648 to


2,147,483,647

Long- -9,223,372,036,854,775,808 to
9,223,372,036,854,775,807
Floating Point Literal

It represents decimals with


fractionals parts.

The float has 4 bytes that stores


fractional numbers sufficient for 6 to
7 decimal digits
While in double it has 8 bytes that
stores sufficient for 15 decimal
digits.
B L
O I Represents the logical
O T value either true or false.
These value are not case
L E sensitive they could be
E R either in uppercase or
A A lowercase and can be valid
N L
Character Literal

It represents a single
character.
STRING LITERAL

Represents multiple
characters and are
enclosed by double
quotes.
1. I have here a box containing the
different typesof literals each
will pick one.

2. Once you pick a card on the bowl


the one that is written in the card
will be the one you will perform.

3. You will perform the activity


within 5 minutes.

You might also like