Visual Basic is an object-oriented programming language that supports object-oriented programming features like abstraction, encapsulation, polymorphism, and inheritance. It emphasizes objects and classes, with a program divided into objects that communicate through functions. Objects are instances of classes that contain data members and methods. Polymorphism allows classes to define methods with the same name but different parameters or in different classes. Inheritance creates new classes from existing base classes.
2. Visual Basic is object-Based, which means it
is a Object-Oriented Programming Language.
Visual Basic .Net supports all features of OOP
like
Abstraction,
Encapsulation,
Polymorphism
and Inheritance.
3. Traditionally, programming has placed an
emphasis on logic and actions.
Object oriented programming has taken a
completely different direction,and will place
an emphasis on objects and information.
With object oriented programming, a problem
will be broken down into a number of units.
These units are called objects.
4. The foundation of OOP is the fact that it will
place an emphasis on objects and classes.
In Object-Oriented programming a program
is divided into object and these object can
communicate with each other through
functions.
6. Object is the basic unit of object-oriented
programming.
Objects are identified by its unique name.
An object represents a particular instance of a
class.
An Object is a collection of data members
and associated member functions also known
as methods.
When a program is executed, objects interact
with each other by sending messages.
7. Objects with similar properties and methods
are grouped together to form a Class.
The actions that can be performed by objects
becomes functions of the class and is
referred to as Methods.
8. Data Abstraction also represents the needed
information in the program without
presenting the details.
9. Data Encapsulation combines data and
functions into a single unit called Class.
When using Data Encapsulation, data is not
accessed directly; it is only accessible
through the functions present inside the
class. Data Encapsulation enables the
important concept of data hiding possible.
10. Poly means many and morph means form.
Thus, polymorphism refers to being able to
use many forms of a type without regard to
the details.
It is the characteristic of being able to assign
a different meaning specifically, to allow an
entity such as a variable, a function, or an
object to have more than one form.
11. Inheritance is the process of forming a new class
from an existing class or base class. The base
class is also known as parent class or super class,
The new class that is formed is called derived
class.
Derived class is also known as a child
class or sub class.
Inheritance helps in reducing the overall code
size of the program, which is an important
concept in object-oriented programming.
12. OOPS provides a clear modular structure for
programs which makes it good for defining
abstract data types .
OOPS makes it easy to maintain and modify
existing code as new objects can be created
with small differences to existing ones.
OOPS provides a good framework for code
libraries where supplied software components
can be easily adapted and modified by the
programmer. This is particularly useful for
developing graphical user interfaces.
13. Polymorphism means many forms (ability to
take more than one form).
In Polymorphism poly means “multiple” and
morph means “forms” so polymorphism
means many forms.
14. In polymorphism we will declare methods
with same name and different parameters in
same class
or
methods with same name and same
parameters in different classes.
Polymorphism has ability to provide different
implementation of methods that are
implemented with same name.
15. In Polymorphism we have 2 different types
they are
- Compile Time Polymorphism (Called as
Early Binding or Overloading or static binding)
- Run Time Polymorphism (Called as Late
Binding or Overriding or dynamic binding)
16.
Compile time polymorphism means we will
declare methods with same name but different
signatures because of this we will perform
different tasks with same method name. This
compile time polymorphism also called as early
binding or method overloading.
Method Overloading or compile time
polymorphism means same method names with
different signatures (different parameters)
17. Run time polymorphism also called as late
binding or method overriding or dynamic
polymorphism. Run time polymorphism or
method overriding means same method
names with same signatures.
18. In this run time polymorphism or method
overriding we can override a method in base
class by creating similar function in derived
class this can be achieved by using
inheritance principle and using “overrides”
keywords.
19.
20. Interfaces in VB.net are used to define the
class members using a keyword Interface,
without actually specifying how it should be
implemented in a Class.
Intefaces are examples for multiple
Inheritance and are implemented in the
classes using the keyword Implements that is
used before any Dim statement in a class.
23. The keyword abstract can be used with both
classes and methods in VB.NET to declare
them as abstract.
24. The classes, which we can't initialize, are
known as abstract classes.
They provide only partial implementations.
But another class can inherit from an abstract
class and can create their instances.
25.
26. An Abstract class doesn't provide full
abstraction but an interface does provide full
abstraction; i.e. both a declaration and a
definition is given in an abstract class but not
so in an interface.
Using Abstract we can not achieve multiple
inheritance but using an Interface we can
achieve multiple inheritance.
27. We can not declare a member field in an
Interface.
We can not use any access modifier i.e. public
, private , protected , internal etc. because
within an interface by default everything is
public.
An Interface member cannot be defined using
the keyword static, virtual, abstract or sealed.