identify the error in the following java statement and correct them
a) long num =50,000;
b) int num =+10;
c) short x+5=15;
d) byte al == 5;
e) boolean x = 1;
f) int x/10=11;
g) char a ="/0";
please do it fast and also give some explain it ...
Answers
Answered by
13
a) long num = 50000 ; ( no comma in value )
b) int num = 10 ; ( no need of + sign)
c) short x = 10 ; ( variable is declared not expression )
d)
e) boolean x = true ; ( boolean can contain true or false)
f) int x = 110 ; ( same reason as part c )
g) char a = '0' ; ( char stores single character)
b) int num = 10 ; ( no need of + sign)
c) short x = 10 ; ( variable is declared not expression )
d)
e) boolean x = true ; ( boolean can contain true or false)
f) int x = 110 ; ( same reason as part c )
g) char a = '0' ; ( char stores single character)
darshika1:
plz give the ans of d also
Similar questions