Professional Documents
Culture Documents
File#21
File#21
Nombre:____________________________________________________
Fecha:__________e-mail:______________________________________
Tiempo para resolverlo: 15 minutos.
1. Which of the following expression is illegal at compile time?(choose
one)
a) double myvalue = 3598.2345F;
b) int mynew = 3598.2345;
c) float myvar = (float) 3598.2345;
d) int myval= (int) A;
2. Which of the following expression is legal at compile time? (choose
one)
a) String x = "10"; int y = 9 ; x += y;
b) String x = "10"; int y = 9 ; if ( x = = y ) { }
c) String x = "10"; int y = 9 ; y+=x;
d) All of the above are legal expressions.
3. Which of the following are primitive data types? (choose one)
a) float, int, double.
b) short, byte, long.
c) A and B are correct.
d) None of the above.
4. Underline the valid declarations for an identifiers(choose five)
a)
b)
c)
d)
e)
j)
int
int
int
int
int
int
.f;
f) int 7g;
_a;
g) int _$;
$c;
h) int -d;
:b;
i) int e#;
______2_w;
this_is_a_very_detailed_name_for_an_identifier;
int
boolean
and
else
struct
f)
g)
h)
i)
j)
for
extend
delete
static
class
k)
l)
m)
n)
o)
return
private
not
new
string
short
float
char
int
bolean
byte
____boolean________________
____char______________________
____int, long, byte, short______
______double, float______________
true, false
1,0
TRUE, FALSE
TRUE, FALSE, true, false
true, false, 1, 0