A continuación tienes las preguntas relacionadas con este capítulo del curso.
Cuestionario 19. 1Z0-808
Cuestionario Summary
0 de 5 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 5 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
- Current
- Revisar
- Respondido/a
- Correcto
- Incorrecto
- Pregunta 1 de 5
1. Pregunta
Given:
class MarksOutOfBoundsException extends IndexOutOfBoundsException { } public class GradingProcess { void verify(int marks) throws IndexOutOfBoundsException { if (marks > 100) { throw new MarksOutOfBoundsException(); } if (marks > 50) { System.out.print("Pass"); } else { System.out.print("Fail"); } } public static void main(String[] args) { int marks = Integer.parseInt(args[2]); try { new GradingProcess().verify(marks); } catch (Exception e) { System.out.print(e.getClass()); } } }
And the command line invocation:
java GradingProcess 89 50 104
What is the result?
CorrectoIncorrecto - Pregunta 2 de 5
2. Pregunta
Given:
interface Pet { } class Dog implements Pet { } public class Beagle extends Dog { }
Which three are valid?
CorrectoIncorrecto - Pregunta 3 de 5
3. Pregunta
Given the code fragment:
StringBuilder sb = new StringBuilder() ; sb.append("world");
Which code fragment prints Hello world?
CorrectoIncorrecto - Pregunta 4 de 5
4. Pregunta
Given the code fragment:
class Student{ String name; int age; }
And,
public class Test{ public static void main(String[] args){ Student s1 = new Student(); Student s2 = new Student(); Student s3 = new Student(); s1 = s3; s3= s2; s2 = null; } }
Which statement is true?
CorrectoIncorrecto - Pregunta 5 de 5
5. Pregunta
Given the code fragment:
class Student { int rollnumber; String name; List cources = new ArrayList(); // insert code here public String toString() { return rollnumber + " : " + name + " : " + cources; } }
And,
public class Test { public static void main(String[] args) { List cs = new ArrayList(); cs.add("Java"); cs.add("C"); Student s = new Student(123, "Fred", cs); System.out.println(s); } }
Which code fragment, when inserted at line // insert code here, enables class Test to print 123 : Fred : [Java, C]?
CorrectoIncorrecto