Preguntas SCJP For JSE5.0

1. ¿Cuáles de los siguientes son identificadores válidos (todos los que apliquen)?
a) int $strictfp;
b) int _int;
c) float volatile_float;
d) short 1_number;
e) byte $1_enum;
f) double const;


2. ¿Dado el atributo 'private** int edad;', cuál debe ser el método setter?**
a) private int setEdad();
b) public int setEdad();
c) private void setEdad(int value);
d) public void setEdad(int value);
e) public int setEdad(int value);


3. Dada la siguiente clase:

1: class AnyBean{
2:     private int attribute1;
3:    public int getAttribute1(){
4:        return this.attribute1;
5:    }
6:    private void setAttribute1(int value){
7:        this.attribute1 = value;
8:    }
9: }

¿Qué línea o líneas no cumplen los estándares de nombrado de los JavaBeans?
a) 1
b) 2
c) 4
d) 5
e) 6
f) Ninguna
g) Todas los cumplen


4. ¿Compilará el archivo 'ExampleClasses.java'?

ExampleClasses.java

class ExampleJava{}
class AnotherExample{}
class IHopeThisWorks{}


5. ¿Compilará la clase 'Example.java'?
strictfp abstract class Example{
abstract int methodX();
}
Respuestas.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.