Object Oriented Programming Flashcards
What is object oriented programming
OOP is a computer programming model that organizes software design around data, or objects rather than functions and logic
What are the basic conepts of OOP
Objects
Classes
Data abstraction
Data encapsulation
Inherintance
Polymorphism
Dynamic binding
Message passing
What is a class
Classes is a blueprint or template from which objects are created.
Mention the types of access specifiers
Private
Public
Protected
What is a private member
A private member of a class means that it can only be accessed within other members of the same class.
In other words the member can’t be accessed or viewed from anywhere outside the class.
What is a public member
This means the members are accessible from anywhere from outside or within the class
What is a public member
This means the members are accessible from anywhere from outside or within the class
What is a protected member
This means the members can only be accessed from members within the same class AND inherinted classes
What is an object
An object is an instantiation of a class. It is an entity that has state and behaviours
Object is said to have state and behaviour. What do those terms mean – state & behaviour
state means data
behavior means functionality
What are methods
Methods are functions that belongs to a class
What is a constructor
A constructor is a special member function have the same name as that of its class. It is called automatically when an object is created.
What is encapsulation
Encapsulation is the idea of keeping sensitive data in one place and restricting access from outside the class. In other words making sure sensitive data is hidden from users.
What is inherintance
This is a feature in OOP where a class can inherit attributes and methods from another class.
What is the difference between a base class and derived class
Base class(parent): the class being inherited from.
Derived class(child): the class that inherits form another class