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

Today's agenda

Quizzes and leanings


int 2 205 semicolonmissing
Quiz 1

Syntan to declare thevariable


a
type variable name value t

b variable type value


name
C variable name value
d none
of the above

Quiz 2
Declare an int variable with name and value 20
y
int 20
y

Quiz 3
int a to
17 127
int 6 209

System out pointen Itf 30


Quiz 4 correct 22g
int a205
20 t 80 20 30
int b 309
System out pointen at b

Quiz 58 case sensitive


int temp to gg
Systemout pointin Temp
Genoa

Quiz6
System out pointer a
senor
int a 109

Quiz 7
int a 20 172
int a 30 error
System out pointer a
Quiz 8
int 2 20 DE
system out point n

2 409
System out pointer n

204400

Quiz 9
int a to
Matt
int b 205operator
assignment

afoot 309 g
System out pointenla
so
variable naming hates

1 Name can contain lowercase uppercase or digitsfo s


or dollar or underscore

2 First letter
of the variable name can't be
number

3 Can't use reserve words as variable name


Reserved words words which are Predefined
in en Public Static void int etc
Java
Quiz 108
int 2 10 w ans t
int
ly 20 xx
int
y b 30 xx
not allowed

How
many of above are correct variable names

Quiz 11
int y to t
int I ans 3
ang 209
int n a 30 xx
int 2 45 t
y
How
many of above are correct variable names

Quiz 12
int Static bog

System out pointin static


G error
data
Different categories of
a number b Tent c boolean
the false
Integers decimal
byte Bhanu Pratap trade service
short
hint
long
0000 000000 0000000
00
Cso too
roky 25kg kg kg
item
5kg Elided I v e
xx xx xx x
75kg

Range capacity
byte 2 to 27 1 L 128,1273
Short 215 to 25 1 L 32768 32767316
int 23 to 231 1 1 n 332
203 to 263 1 L 364
long
Exact explanation
of how
we
got
this range is in BITS Class
The default value is int in Java

Break till 9 28PM

Typecasting

5kg
Ei 25kg
00
5kg
0
25kg
80

7kg 88
0000 00 0000
no
25kg no
kg 25kg kg

15kg
0000 00 ooo Ég
no
ey
25kg roig 25kg kg

I 1
implicit explicit
Cautomatic
forced
end int n too

long y n implicit

enz long 2 1000


int int
2g explicit
y
appooan
int 23 to 23 1 1 2 109 to 2 105

long 203 to 263 1 1 2 1018 to 2 108


Qui 2138
int a toooo 174
implicit 10
long b as
System out pointer s

Quiz 14
enggitecasting
long 2 100000
int int n
int y 2 explicit y
System outpointer y
Gentoo

Quiz 158
as to't long
long I
int int
og aint b a

system out pointer s


random value
Qui216
input 30
scanner son new scanner system.in error
int n sch nent Intl

System out pointer a

Quiz 17
input 30
Scanner son new Scanner system.in error
int n sch nent Intl

System out pointer a

Quiz 17
input 30
Scanner son new Scanner Gystem.in

int n sch nent Intl

System out pointer a

630
input 24 30
Scanner son new Scanner Gystem.in

int
int
n sch nent Intl
son nent Intl
B
y
systemoutpointing
G 224

You might also like