Saltar al contenido

www. La Mandarina Mecánica .es

…ahora con internet los niños se te educan solos… Homer Simpson…

Archivo

Categoría: Pregunta Certificación

Os dejo 10 preguntas de la certificación java.

continúe leyendo…

Which of the following returns true? 
  
  –  “john”.equals(”john”)
 
  –   “john” = “john”
 
  –   new String(”john”) == new String(”john”)
La respuesta está en los comentarios.

Otra de amigos.

Si escribo este código tal cual , ¿En cuantas líneas tendría errores?

class Foo { 
     
public void foolish() {
 
         
Object o = new char[0][];
 
         
if (true | true) {
 
             
for (;;);
 
         
} else if (false & false) {
 
             
do; while (true);
 
         
}
 
         ftp
:
//ftp.foo.com 
 
        while (true);
 
     
}
 
 
}


Dejar la respuesta en comentarios, y luego  pongo la explicación en comentarios.

What will be the output of the following code:

System.out.println(1+1 + “==” + 1+1 + “?”); 
     
 -    2==2?
 -   11=11?
 -   2==11?
 -   11==2? 
 -  compile error, because mixing up arithemtic addition and string    concatenation is not allowed

Responder en comentarios. (Si os atreveis).