A continuación tienes las preguntas relacionadas con este capítulo del curso.
Cuestionario 23. 1Z0-808
Cuestionario Summary
0 de 6 preguntas completadas
Preguntas:
Información
You have already completed the cuestionario before. Hence you can not start it again.
Cuestionario is loading…
You must sign in or sign up to start the cuestionario.
En primer lugar debes completar esto:
Resultados
Resultados
0 of 6 questions answered correctly
Your time:
El tiempo ha pasado
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categorías
- Sin categorizar 0%
- 1
- 2
- 3
- 4
- 5
- 6
- Current
- Revisar
- Respondido/a
- Correcto
- Incorrecto
- Pregunta 1 de 6
1. Pregunta
Given:
public class TestLoop { public static void main(String[] args) { float myarray[] = {10.20f, 20.30f, 30.40f, 50.60f}; int index = 0; boolean isFound = false; float key = 30.40f; // insert code here System.out.println(isFound); } }
Which code fragment, when inserted at line 7, enables the code print true?
CorrectoIncorrecto - Pregunta 2 de 6
2. Pregunta
Given:
class Base { public static void main(String[] args) { System.out.println("Base " + args[2]); } } public class Sub extends Base { public static void main(String[] args) { System.out.println("Overriden " + args[1]); } }
And the commands:
javac Sub.java
java Sub 10 20 30What is the result?
CorrectoIncorrecto - Pregunta 3 de 6
3. Pregunta
class SpecialException extends Exception { public SpecialException(String message) { super(message); System.out.println(message); } } public class ExceptionTest { public static void main(String[] args) { try { doSomething(); } catch (SpecialException e) { System.out.println(e); } } static void doSomething() throws SpecialException { int[] ages = new int[4]; ages[4] = 17; doSomethingElse(); } static void doSomethingElse() throws SpecialException { throw new SpecialException("Thrown at end of doSomething() method"); } }
What will be the output?
CorrectoIncorrecto - Pregunta 4 de 6
4. Pregunta
Given the code fragment:
interface Contract { } class Super implements Contract { } class Sub extends Super { } public class Ref { public static void main(String[] args) { List objs = new ArrayList(); Contract c1 = new Super(); Contract c2 = new Sub(); // line n1 Super s1 = new Sub(); objs.add(c1); objs.add(c2); objs.add(s1); // line n2 for (Object itm : objs) { System.out.println(itm.getClass().getName()); } } }
What is the result?
CorrectoIncorrecto - Pregunta 5 de 6
5. Pregunta
Given:
public class Test { public static void main(String[] args) { Test ts = new Test(); System.out.print(isAvailable + " "); isAvailable = ts.doStuff(); System.out.println(isAvailable); } public static boolean doStuff() { return !isAvailable; } static boolean isAvailable = false; }
What is the result?
CorrectoIncorrecto - Pregunta 6 de 6
6. Pregunta
public class Msg { public static String doMsg(char x) { return "Good Day!"; } public static String doMsg(int y) { return "Good Luck!"; } public static void main(String[] args) { char x = 8; int z = '8'; System.out.println(doMsg(x)); System.out.print(doMsg(z)); } }
What is the result?
CorrectoIncorrecto