Data Types I
Data Types I
Java .
Data Types in Java
woul
as
int = 10 5 ; x
·
/ it
boolean b = 0
; X
8
Patatypes
Like
3 Gi
·
Int
Char
·
signed
long
·
·
Double
Byte point
·
Short
Slowing
·
float
Q. Char Datatype can store a single character so why is it of size
2 bytes and what is \U0000?
While using 16 bits for every character may seem like overkill for representing many
characters that only need 8 bits (or even fewer), Java's design emphasizes consistency,
portability, and robust internationalization support. This design decision ensures that Java
can handle text and characters from various languages and character sets without
requiring extensive conversions or adjustments.
⑮
I
S 0 .
ph (c 1)+
I
, O
1166 on
C 2
.
-
intn=c ; 1165 Cert
"
craw b :
I hard m :
int a :
"A-is' ;
Chart= 65; v
AB 2B
byte- Shoot
uB
testin
↑ int
long > -
float s Double
- VB 8 B YB 8B
Char
4 ?
Tnese] [
Floating-point
In memory is
way
to
represent no ·
byte b =
= byte b = 100 ,
b = b+ 2 ; Il Error
- -