A continuación tienes las preguntas relacionadas con este capítulo del curso.
Cuestionario 20. 1Z0-808
Límite de tiempo: 0
Resumen del Cuestionario
0 of 6 Preguntas completed
Preguntas:
Información
Ya has completado el cuestionario anteriormente. Por lo tanto no puedes iniciarlo de nuevo.
Cargando Cuestionario…
Debes iniciar sesión o registrarte para empezar el cuestionario.
En primer lugar debes completar esto:
Resultados
Cuestionario completado. Tus resultados están siendo registrados.
Resultados
0 de 6 Preguntas respondidas correctamente
Tu tiempo:
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
- Actual
- Revisar
- Respondido/a
- Correcto
- Incorrecto
- Pregunta 1 de 6
1. Pregunta
Given:
public class Test2 { public static void main(String[] args) { int ar1[] = {2, 4, 6, 8}; int ar2[] = {1, 3, 5, 7, 9}; ar2 = ar1; for (int e2 : ar2) { System.out.print(" " + e2); } } }
What is the result?
CorrectoIncorrecto - Pregunta 2 de 6
2. Pregunta
Given:
public class Test2 { public static void doChange(int... arr) { for (int pos = 0; pos < arr.length; pos++) { arr[pos] = arr[pos] + 1; } } public static void main(String[] args) { int[] arr = {10, 20, 30}; doChange(arr); for (int x : arr) { System.out.print(x + ", "); } doChange(arr[0], arr[1], arr[2]); System.out.print(arr[0] + ", " + arr[1] + ", " + arr[2]); } }
What is the result?
CorrectoIncorrecto - Pregunta 3 de 6
3. Pregunta
Given:
public class Natural { private int i; void disp() { while (i <= 5) { for (int i = 1; i <= 5;) { System.out.print(i + " "); i++; } i++; } } public static void main(String[] args) { new Natural().disp(); } }
What is the result?
CorrectoIncorrecto - Pregunta 4 de 6
4. Pregunta
Given:
public class Test { public static void main(String[] args) { int day = 1; switch (day) { case "7": System.out.print("Uranus"); case "6": System.out.print("Saturn"); case "1": System.out.print("Mercury"); case "2": System.out.print("Venus"); case "3": System.out.print("Earth"); case "4": System.out.print("Mars"); case "5": System.out.print("Jupiter"); } } }
Which two modifications, made independently, enable the code to compile and run?
CorrectoIncorrecto - Pregunta 5 de 6
5. Pregunta
Given:
public class TestLoop { public static void main(String[] args) { int array[] = {0, 1, 2, 3, 4}; int key = 3; for (int pos = 0; pos < array.length; ++pos) { if (array[pos] == key) { break; } } System.out.print("Found " + key + " at " + pos); } }
What is the result?
CorrectoIncorrecto - Pregunta 6 de 6
6. Pregunta
import java.util.ArrayList; import java.util.List; public class Ref { public static void main(String[] args) { StringBuilder s1 = new StringBuilder("Hello Java!"); String s2 = s1.toString(); List
lst = new ArrayList (); lst.add(s2); System.out.println(s1.getClass()); System.out.println(s2.getClass()); System.out.println(lst.getClass()); } } What is the result?
CorrectoIncorrecto