A continuación tienes las preguntas relacionadas con este capítulo del curso.
Cuestionario 6. 1Z0-808
Resumen del Cuestionario
0 of 5 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
Resultados
0 de 5 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
- Actual
- Revisar
- Respondido/a
- Correcto
- Incorrecto
- Pregunta 1 de 5
1. Pregunta
Given the code fragment:
int num[][] = new int[1][3]; for (int i = 0; i < num.length; i++) { for (int j = 0; j < num[i].length; j++) { num[i][j] = 10; } }
Which option represents the state of the num array after successful completion of the outer loop?
CorrectoIncorrecto - Pregunta 2 de 5
2. Pregunta
Given the code fragment:
public class Person { String name; int age = 25; public Person(String name) { this(); // line n1 setName(name); } public Person(String name, int age) { Person(name); // line n2 setAge(age); } //setter and getter methods go here public String show() { return name + " " + age; } public static void main(String[] args) { Person p1 = new Person("Jesse"); Person p2 = new Person("Walter", 52); System.out.println(p1.show()); System.out.println(p2.show()); } }
What is the result?
CorrectoIncorrecto - Pregunta 3 de 5
3. Pregunta
Given the following code for a Planet object:
public class Planet { public String name; public int moons; public Planet(String name, int moons) { this.name = name; this.moons = moons; } }
And the following main method:
public static void main(String[] args) { Planet[] planets = { new Planet("Mercury", 0), new Planet("Venus", 0), new Planet("Earth", 1), new Planet("Mars", 2) }; System.out.println(planets); System.out.println(planets[2]); System.out.println(planets[2].moons); }
What is the output?
CorrectoIncorrecto - Pregunta 4 de 5
4. Pregunta
You are asked to develop a program for a shopping application, and you are given the following information:
1. The application must contain the classes Toy, EduToy, and consToy. The Toy class is the superclass of the other two classes.
2. The int caicuiatePrice (Toy t) method calculates the price of a toy.
3. The void printToy (Toy t) method prints the details of a toy.Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?
CorrectoIncorrecto - Pregunta 5 de 5
5. Pregunta
Give the following code:
int[] intArr = {15, 30, 45, 60, 75}; intArr[2] = intArr[4]; intArr[4] = 90;
What are the values of each element intArr after this code has executed?
CorrectoIncorrecto