• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 7 páginas
Examen

Cmsc132 Questions And Answers Fully Solved

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

Exam of 7 pages for the course CMSC 132 at CMSC 132 (CMSC132)

Vista previa del contenido

CMSC132

Abstraction provides - answer high level model of activity

Procedural abstraction - answer Specifies actions performed
hides algorithms

Data abstraction - answer Specifies data objects for the problem
Hides implementations

Encapsulation - answer hides implementation details while providing interface
(methods) for data access
allows us to use code without knowing its implementation
makes debugging and code modification simple

Interface - answer Set of abstract methods
Specifies a contract for a class to implement

Class - answerimplements/defines contract

Collection - answergroups multiple elements into one object

Inheritance - answer- Process in which a derived class (subclass) is created from a
base class (superclass)
- inherits all the superclass methods and instance variables that are marked protected
or public
Creates a hierarchical structure for a group of objects, avoids code duplication

Shadowing - answerOverriding variables in subclasses

Inheritance and private - answerAll private data is inherited by subclasses
However, private members of a superclass cannot be accessed directly

When an object/method is marked protected it is accessible by... - answer- any
subclasses
- any class in the same package

The class Object has these methods... - answerequals(Object other)
toString()

Late (dynamic binding) - answermethod that is called depends on the objects actual
type, not the declared type of the reference variable
Java uses late binding

, Provides more flexibility

Overloading - answerWriting multiple methods of the same name with different number
of parameters/parameter types

Overriding - answerRedefining a method in a subclass

protected access modifier - answerOnly subclasses and classes in the same package
can access

No access modifier (package protected) means class that are _________ can access -
answerIn the same package

Early (static) binding - answermethod that is called depends on the declared type of the
reference variable
More efficient

Abstract class (what and why) - answerClass that cannot create an actual object
Used if logical values cannot be defined for instance variables
public class abstract Animal{
...}
Required if class contains an abstract method

Abstract method - answerProvides method signature
method that does not have any implementation
Why? every subclass will have method (implement in own way)
require abstract class
Cannot be final

What are 3 common uses of Interfaces? - answerPrimary purpose: specifying minimum
functional requirements for a class
Workaround for Java's lack of multiple inheritance
Rare: For defining groups of related symbolic constants

Rules for overriding methods regarding access specifier... - answerDerived class may
change the access specifier, but cannot decrease visibility

How do you disable overriding in derived classes - answerUse "final"

Inner classes (what and why) - answerClass defined in scope of another class
Outer/inner class can access all of each others methods and fields
Has an instance of the outer class object as soon as it is created

Nested Class (what and why) - answerSimilar to inner class but declared "static"
No linkage to outer class
Only access to static methods and fields of outer class

Información del documento

Subido en
23 de junio de 2025
Número de páginas
7
Escrito en
2024/2025
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.
Dreamer252
4.0
(117)
Vendido
497
Seguidores
297
Artículos
21575
Última venta
2 meses 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