Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 9 páginas
Examen

COMP 1231 Questions with complete solution 2025

Document preview thumbnail
Vista previa 2 fuera de 9 páginas

COMP 1231 Questions with complete solution 2025 From which problems is it possible for a program to recover - correct answer Exceptions Both class Error and class Exception are children of this parent: - correct answer Throwable Is a program required to catch all exceptions that might happen? - correct answer No. You can write a program to catch just the exceptions you want. What type of exception is thrown by nextInt() if it gets illegal data - correct answer InputMismatchException try{} block - correct answer - Some will never throw an exception. - may throw several types of exception. - must appear before the catch{} blocks. - can contain loops or branches. catch{} block - correct answer - There can be several " " blocks in a try/catch structure.

Vista previa del contenido

COMP 1231 Questions with complete
solution 2025
From which problems is it possible for a program to recover - correct answer
✔Exceptions


Both class Error and class Exception are children of this parent: - correct
answer ✔Throwable


Is a program required to catch all exceptions that might happen? - correct
answer ✔No. You can write a program to catch just the exceptions you want.


What type of exception is thrown by nextInt() if it gets illegal data - correct
answer ✔InputMismatchException


try{} block - correct answer ✔- Some will never throw an exception.


- may throw several types of exception.


- must appear before the catch{} blocks.


- can contain loops or branches.


catch{} block - correct answer ✔- There can be several " " blocks in a
try/catch structure.


- The " " block for a child exception class must PRECEDE that of a parent
exception class.

, - If there is no " " block there must be a finally{} block


What happens in a method if an exception is thrown in a try{} block and there
is NO MATCHING catch{} block? - correct answer ✔The method throws the
exception to its caller, exactly if there were no try{} block.


How many finally{} blocks may there be in a try/catch structure? - correct
answer ✔There can be zero or one, following the last catch{} block.


When is a finally{} block executed? - correct answer ✔Always after execution
has left a try{} block, no matter for what reason.


What is a method's signature? - correct answer ✔It is the name of the
method and the data types of its parameters.


What must be true if a child of an abstract parent class does not override all of
the parent's abstract methods - correct answer ✔The child class itself must
be declared to be abstract.


What must a non-abstract child do about an abstract method in its parent
class? - correct answer ✔A child must override an abstract method inherited
from its parent by defining a method with the same signature and same return
type


What type of inheritance does Java have? - correct answer ✔single
inheritance


Can an object be a subclass of another object? - correct answer ✔No—
inheritance is only between classes.

Información del documento

Subido en
13 de agosto de 2025
Número de páginas
9
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$17.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
LEWISSHAWN55
2.9
(11)
Vendido
96
Seguidores
46
Artículos
7346
Última venta
6 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes