Operadores java

Solo disponible en BuenasTareas
  • Páginas : 2 (304 palabras )
  • Descarga(s) : 0
  • Publicado : 23 de diciembre de 2011
Leer documento completo
Vista previa del texto
Tarea 1

1.-

X=45;

Y= ++ X;
Z= Y++;
F= --Z;
F+=3+X;
G= X--;
K= X % 7;
Cual es el valor de todas las variables

2.-

F= -8;

K=-F;
G= ~ F;
J =G>>3;
J%=3;
Cual es el valor de todas las variables

3.- Convierte 367, 673, 743, 235 a octal, hexadecimal y binario

4.- Has las instrucciones para pasar eldato
double x = 456.65;

a byte, short, int, long y float

5.- realize las siguientes operaciones de bits

X= 56 ; //111011
Y=67; //1000011

F= X & Y;
G=X | Y;
H= X ^ Y;
Cual es el valor de todas las variables

6. Which is a reserved word in the Java programming language? (Choose one.)
A. method
B. native
C.subclasses
D. reference
E. array
7. Which one of these lists contains only Java programming language keywords? (Choose one.)
A. class, if, void, long, Int, continue
B.goto, instanceof, native, finally, default, throws
C. try, virtual, throw, final, volatile, transient
D. strictfp, constant, super, implements, do
E. byte, break, assert,switch, include

8. Which two are keywords? (Choose two.)
A. interface
B. unsigned
C. Float
D. this
E. string

9. Which three are valid declarations of a char?(Choose three.)
A. char c1 = 064770;
B. char c2 = ‘face’;
C. char c3 = 0xbeef;
D. char c4 = \u0022;
E. char c5 = ‘\iface’;
F. char c6 = ‘\uface’;

10. What is thenumerical range of a char? (Choose one.)
A. –128 to 127
B. –(2 ^ 15) to (2 ^ 15) - 1
C. 0 to 32767
D. Platform dependent
E. 0 to 65535

11. Which three are validdeclarations of a float? (Choose three.)
A. float f1 = -343;
B. float f2 = 3.14;
C. float f3 = 0x12345;
D. float f4 = 42e7;
E. float f5 = 2001.0D;
F. float f6 = 2.81F;
tracking img