Object Oriented Programming Key PASSED Questions and CORRECT Answers
EncapsulationEncapsulation means putting together all the variables (instance variables) and the methods into a single unit called Class. It also means hiding data and methods within an Object. Encapsulation provides the security that keeps data and methods safe from inadvertent changes. Programmers sometimes refer to encapsulation as using a "black box," or a device that you can use without regard to the internal mechanisms. InheritanceAn important feature of object-oriented programs is inheritance—the ability to create classes that share the attributes and methods of existing classes, but with more specific features. Inheritance is mainly used for code reusability. So you are making use of already written class and further extending on that. That why we discussed about the code reusability the concept. In general, one line definition we can tell that deriving a new class from existing class, it's called as Inheritance. You can look into the following example for inheritance concept. Here we have Mobile class extended by other specific class like Android and Blackberry.
Escuela, estudio y materia
- Institución
- Object Oriented Programming
- Grado
- Object Oriented Programming
Información del documento
- Subido en
- 13 de mayo de 2024
- Número de páginas
- 9
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
object oriented programming
Documento también disponible en un lote