Oops and CG
Oops and CG
Inheritance
Encapsulation
Polymorphism
Data Abstraction
To know more about OOPs in JAVA, Python, and C++ you can go
through the following blogs:
JAVA OOPs Concepts
Python OOPs Concepts
C++ OOPs Concepts
5. What is an object?
Yes, you can call the base class without instantiating it if:
It is a static method
The base class is inherited by some other subclass
Object Class
A class is basically a template or
A real-world entity which is an
a blueprint within which objects
instance of a class
can be created
An object acts like a variable of Binds methods and data together
the class into a single unit
An object is a physical entity A class is a logical entity
Objects take memory space when A class does not take memory
they are created space when created
Objects can be declared as and
Classes are declared just once
when required
To know more about objects and classes in JAVA, Python, and C++
you can go through the following blogs:
Objects in Java
Class in Java
Objects and classes in Python
Objects in C++
Single inheritance
Multiple inheritance
Multilevel inheritance
Hierarchical inheritance
Hybrid inheritance
Inheritance in Java
Inheritance in Python
A class that inherits from another class is called the subclass. For
example, the class Car is a subclass or a derived of Vehicle class.
Overloading Overriding
Two or more methods having the Child class redefining methods
same name but different present in the base class with the
parameters or signature same parameters/ signature
Resolved during compile-time Resolved during runtime
To know more about polymorphism in Java and Python, read the
below articles:
Polymorphism in Java
Polymorphism in Python
Encapsulation refers to binding the data and the code that works on
that together in a single unit. For example, a class. Encapsulation also
allows data-hiding as the data specified in one class is hidden from
other classes.
26. What are ‘access specifiers’?
Accessibility
Accessibility Accessibility
Name from derived
from own class from world
class
Public Yes Yes Yes
Private Yes No No
Protected Yes Yes No
To know more about encapsulation read along:
Encapsulation in Java
Encapsulation in C++
Encapsulation in Python
Data abstraction
Abstract class
Abstract method
Virtual functions are functions that are present in the parent class and
are overridden by the subclass. These functions are used to achieve
runtime polymorphism.
Default constructor
Parameterized constructor
Copy constructor
Static constructor
Private constructor
39. What is a copy constructor?
Class Method
A class is basically a template
Callable set of instructions also
that binds the code and data
called a procedure or function that
together into a single unit.
are to be performed on the given
Classes consist of methods,
data
variables, etc
43. Differentiate between an abstract class and an interface?
Error Exception
Errors are problems that should not be Conditions that an application might try to
encountered by applications catch
47. What is a try/ catch block?
A try/ catch block is used to handle exceptions. The try block defines a set of
statements that may lead to an error. The catch block basically catches the exception.
A finally block consists of code that is used to execute important code such as closing a
connection, etc. This block executes when the try block exits. It also makes sure that
finally block executes even in case some unexpected exception is encountered.
Output Primitives :
DDA Line generation Algorithm in Computer Graphics.
Bresenham's Line Generation Algorithm.
Mid-Point Line Generation Algorithm.
Program to find line passing through 2 Points.
Bresenham's circle drawing algorithm.
Anti-aliased Line | Xiaolin Wu's algorithm.
DDA:- a digital differential analyzer (DDA) is hardware or software used for interpolation of
variables over an interval between start and end point. ... DDAs are used for rasterization
of lines, triangles and polygons.
Polygon filling:- filling polygons with particular colors, you need to determine the pixels falling
on the border of the polygon and those which fall inside the polygon. Types:- Flood fill, Seed
fill, Scan line fill.
Shading model is used to compute the intensities and colors to display the surface.
The shading model has two primary ingredients: properties of the surface and properties of the
illumination falling on it. The principal surface property is its reflectance, which determines how
much of the incident light is reflected.
B-splines:- have knots that are equidistant from each other. B-splines can be used for curve-
fitting and numerical differentiation of experimental data. In computer-aided design
and computer graphics, spline functions are constructed as linear combinations of B-
splines with a set of control points.