100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

CMSC132 Exam -1. Questions and Answers Fully Solved

Puntuación
-
Vendido
-
Páginas
6
Grado
A+
Subido en
23-06-2025
Escrito en
2024/2025

Exam of 6 pages for the course CMSC 132 at CMSC 132 (CMSC132 Exam -1.)

Institución
CMSC 132
Grado
CMSC 132









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CMSC 132
Grado
CMSC 132

Información del documento

Subido en
23 de junio de 2025
Número de páginas
6
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

CMSC132 Exam #1

Serializing Objects - answer An object can be represented as a sequence of bytes that
includes the objects data as well as information about the objects type and the types of
data stored.

Super() - answer A method call in a sub class constructor invokes the superclass
constructor

Overloading - answer Having multiple methods with same name but different signatures
in a class

Overriding - answer Overrides the functionality of an existing method but not if it is
marked final

Inheritance - answer The process where one object acquires the properties of another

Is-A Relationship - answer Animal is the superclass of Mammals class therefore
Mammals _______ Animal

Has-A Relationship - answerDetermines whether a certain class _______ certain thing
(hint: some sort of relationship between super class and sub class)

Downcasting - answerSuperclass to subclass

Upcasting - answerSubclass to superclass
- not allowed because it throws an exception

Scanner - answerBreaks input into logical constructs, delimited by whitespace
(hint: Some methods include: hasNext(), nextInt(), next(), etc. of the java I/O)

Syntax for Scanner - answerScanner sc = new Scanner(System.in)
int i = sc.nextInt() //for int
String s = sc.next() //for String

equals(object obj) using getClass() - answerCompares memory reference

if(obj == this)
return true;
else if(obj != null && obj.getClass() == this.getClass())
Platypus p = (Platypus) obj;
return name.equals(p.name) && weight == p.weight etc.

, equals(object obj) using instanceof - answerCompares memory reference

if(obj == this)
return true;
else if(obj instanceof Platypus)
Platypus p = (Platypus) obj;
return name.equals(p.name) && weight == p.weight etc.
else return false;

instanceof vs. getClass() - answerinstanceof does the same thing but getClass() has to
make sure that object being compared is not null
hence: obj != null && obj.getClass() == this.getClass()

Inner Class - answerIs a class defined inside the scope of another class

Static Nested Classes - answerA nested class that's declared as a static class

Attributes of a Static Nested Class - answer- Can ONLY access static fields and
methods of the outer class
- No link to an instance of the outer class
- Is not associated with an outer class
- Does not survive longer than an outer class
(Answer: Attributes of a ____ ____ Class)

Different type of Inner Classes - answer1) Static Nested class
2) Anonymous class
3) Member Inner class // did not learn yet
3) Method-Local Inner class // did not learn yet
(Answer: Different type _____ Class)

What are Inner Class good for? - answer1) Can access all fields & methods of the
enclosing class
2) Increases the level of Encapsulation
3) Private helper class
- logical grouping of functionality
- Data hiding
4) Linkage to outer class
- An inner class object is tied to an outer class object

Enum Types - answerA type that has a fixed set of values, specifies all possible values
by listing them.
(hint: values(),valueOf(), name(), compareTo()...)

Encapsulation - answerTechnique of making the fields/methods/class in a class private
and providing access
$17.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada


Documento también disponible en un lote

Conoce al vendedor

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.
Dreamer252 NBursing
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
478
Miembro desde
2 año
Número de seguidores
293
Documentos
21304
Última venta
1 semana hace

4.0

115 reseñas

5
60
4
22
3
18
2
2
1
13

Recientemente visto por ti

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