A continuación tienes las preguntas relacionadas con este capítulo del curso.
Cuestionario 12. 1Z0-808
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
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 the code fragment:
public static void main(String[] args) { String str = " "; str.trim(); System.out.println(str.equals("") + " " + str.isEmpty()); }
What is the result?
CorrectoIncorrecto - Pregunta 2 de 6
2. Pregunta
Given:
class CD { int r; CD(int r) { this.r = r; } } class DVD extends CD { int c; DVD(int r, int c) { // line n1 } }
And given the code fragment:
DVD dvd = new DVD(10, 20);
Which code fragment should you use at line n1 to instantiate the dvd object successfully?
CorrectoIncorrecto - Pregunta 3 de 6
3. Pregunta
Given the code fragment:
int a[] = {1, 2, 3, 4, 5}; for (XXX) { System.out.print(a[e]); }
Which option can replace xxx to enable the code to print 135?
CorrectoIncorrecto - Pregunta 4 de 6
4. Pregunta
Which statement best describes encapsulation?
CorrectoIncorrecto - Pregunta 5 de 6
5. Pregunta
Which statement best describes encapsulation?
CorrectoIncorrecto - Pregunta 6 de 6
6. Pregunta
Given the following class:
public class CheckingAccount { public int amount; public CheckingAccount(int amount) { this.amount = amount; } public int getAmount() { return amount; } public void changeAmount(int x) { amount += x; } }
And given the following main method, located in another class:
public static void main(String[] args){ CheckingAccount acct = new CheckingAccount((int)(Math.random() * 1000)); //line n1 System.out.println(acct.getAmount()); }
Which three lines, when inserted independently at line n1, cause the program to print a 0 balance?
CorrectoIncorrecto