Hello Friends,
Today I am writing this post because of this is very important question in interview . And Before starting programming you should be about the concepts of Oops.
What is OOP?
The object oriented programming is commonly known as OOP. Most of
the languages are developed using OOP concept. Object-oriented programming
(OOP) is a programming concept that uses "objects" to develop a
system.
A programming object has an ability to perform actions and has
attributes. It performs just like real world entities for e.g. a motor bike. A
bike performs actions such as ’Start’, ’Stop’ etc., and it has attributes like
red color, 150 cc etc. So does an Object. Actions and attributes are
represented by Methods and fields or properties respectively in programming
language.
An object hides the implementation details and exposes only the
functionalities and parameters it requires to its client. Here also an object
shares the same concept as that of a bike. While driving a motor bike, we are
unaware of its implementation details such as how it is developed, internal
working of gears etc.? We know only the functions or actions it can perform.
What are the various
elements of OOP?
Various elements of OOP are:
• Object
• Class
• Method
• Encapsulation
• Information Hiding
• Inheritance
• Polymorphism
Explain an object.
An object is an entity that keeps together state and behaviors.
For instance, a car encapsulates state such as red color, 900 cc etc and
behaviors as ’Start’, ’Stop’ etc., so does an object.
An object is an instance of a class. If you consider Dog as a class, it will contain all possible
dog traits, while object German Shepherd contains characteristics of specific type of dog.
Define a class.
A class represents description of objects that share same
attributes and actions. It defines the characteristics of the objects such as
attributes and actions or behaviors. It is the blue print that describes objects.
What is Method?
Method is an objects behavior. If you consider Dog as an object then its behaviors are bark,
walk, run etc.
Explain Encapsulation
concept in OOP.
Encapsulation means keeping actions and attributes together under
a single unit.
This can also be understood using a motor bike example. A bike has
actions such as ‘switch on light’, ’horn’ etc. and attributes such specific
color, size, weight etc. Here
the actions and attributes are bundled together under a single
unit, bike.
In a programming language, methods and properties that correspond
to actions and attributes respectively are kept under a unit called object. The
advantage of encapsulation is that the implementation is not accessible to the
client. The user has to know only the functionality of encapsulated unit and
information to be supplied to get the result.
What is Information Hiding
in OOP?
Information hiding concept restricts direct exposure of data. Data
is accessed indirectly using safe mechanism, methods in case of programming
object. Taking bike as an example, we have no access to the piston directly, we
can use ’start button’ to run the piston. You can understand the advantage of
information hiding concept from this example. If a bike manufacturer allows
direct access to piston, it would be very difficult to control actions on the
piston.
Define Inheritance.
Inheritance concept in OOP allows us to create a new class using
an existing one. It also allows the new class to add its own functionality.
This concept can also be related to real world entity. A bike manufacturer uses
same mechanism of existing version of the bike while launching a new version
with some added functionalities.
This allows him to save time and efforts.
Explain the term
Polymorphism.
Polymorphism means the ability to take more than one form. An
operation may exhibit different behaviors in different instances. The behavior
depends on the data types used in the operation.
What is Overloading
Polymorphism?
Overloading allows multiple functions to exist with same name but
different
parameters. Again if you take bike as an example, it has a
function Start with two forms i.e. ’Auto Start’ and ’kick
start’.
Explain Overriding
Polymorphism.
Overriding means changing behavior of methods of base class in
derive class by overriding the base class methods. If class A is a base class
with method ’calculate’ and class B inherits class A, thus derives method
’calculate’ of class A. The behavior of ’calculate’ in class B can be changed
by overriding it.
What are the advantages of
OOP?
Following are the advantages of OOP:
• It presents a simple, clear and easy to maintain structure.
• It enhances program modularity since each object exists
independently.
• New features can be easily added without disturbing the existing
one.
• Objects can be reused in other program.
If you like this post share it.. If you encounter any problems, feel free and comment below to find solution. Share Your Experience with us.
I gone through your article, its really interesting. Dot net is most used programming language for creating highly dynamic desktop and web application. Dot net programming language has created massive revolution in software development industry. Dot net training in Chennai
ReplyDeleteGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
ReplyDeleteRegards,
sas training in Chennai|sas course in Chennai|sas training institute in Chennai
Excellent Post, I welcome your interest about to post blogs. It will help many of them to update their skills in their interesting field.
ReplyDeleteRegards,
Angularjs training in chennai|Angularjs training chennai|Angularjs course in chennai
useful blog
ReplyDeleteasp dot net training | best asp dot net training | asp dot net training and placement | best asp dot net training institute in chennai
I may be crazy but, the idea has been nagging me for some time that perhaps the biggest favor we could do for the African poor would be to kill off all that dangerous wild life.
ReplyDeleteBest ASP.NET Training in Gurgaon
Thank you so much for sharing... lucky patcher no root apk
ReplyDeleteInformative blog and it was up to the point describing the information very effectively. Thanks to blog author for wonderful and informative post.
ReplyDeleteIOS Application Developers Chennai | IOS Application Developers in Chennai | IOS App Developers in Chennai
Nice blog. Explained well. I have suggested to my friends to go through this blog.Thank you for sharing this useful information.If you want to learn .Net or dotnet course in online, please visit below site.
ReplyDeletedotnet Online Training, dotnet course, dotnet online training in kurnool, dotnet online training in hyderabad, dotnet online training in bangalore, online courses, online learning, online education, trending courses, best career courses
This is the best explanation I have seen so far on the web. I was looking for a simple yet informative about this topic finally your site helped me allot
ReplyDeleteSelenium training in chennai
Selenium training institute in Chennai
ios developer course in chennai
ios classes in chennai
JAVA Training Chennai
JAVA J2EE Training in Chennai
Nice Article,Great experience for me by reading this info.
ReplyDeletethanks for sharing the information with us.keep updating your ideas.
Java Institutes in bangalore
Java Training in Thirumangalam
Java Institute in T nagar
Java Training in Sholinganallur
Useful blog, This is what I have looked for. Share more like this.
ReplyDeleteDevOps certification Chennai
DevOps Training in Chennai
DevOps Training institutes in Chennai
Blue Prism Training Chennai
RPA courses in Chennai
UiPath Training Institutes in Chennai
This is excellent information. It is amazing and wonderful to visit your site. Thanks for sharing this information, this is useful to me...
ReplyDeleteOracle Training in Chennai
Oracle Training
Oracle Training institute in Chennai
VMware Training in Chennai
Vmware Learning
Vmware Cloud Certification
Very informative blog! I liked it and was very helpful for me. Thanks for sharing. Do share more ideas regularly.
ReplyDeleteIELTS Tambaram
IELTS Coaching in Chennai Tambaram
IELTS Classes near me
IELTS Velachery
IELTS Training in Chennai Velachery
IELTS Training in Velachery
IELTS Coaching Centre in Velachery
Awesome Post. It was a pleasure reading your article. Thanks for sharing.
ReplyDeletePega training in chennai
Pega course in chennai
Pega training institutes in chennai
Pega course
Pega training
Pega certification training
Pega developer training
Very nice blog, Thank you for providing good information.
ReplyDeleteAirport management courses in chennai
diploma in airport management in chennai
diploma in airport management course in chennai
diploma in airline and airport management in chennai
Such an excellent and interesting blog, Do post like this more with more information, This was very useful, Thank you.
ReplyDeleteAir hostess training in Chennai
Air Hostess Training Institute in chennai
cabin crew training in Chennai
cabin crew course in chennai
Amazing Post. Great write-up. Extra-ordinary work. Waiting for your next Post.
ReplyDeleteSocial Media Marketing Courses in Chennai
Social Media Marketing Training in Chennai
Social Media Training in Chennai
Social Media Marketing Training
Social Media Marketing Courses
Social Media Training
Social Media Marketing Training
Social Media Courses
Its a wonderful post and very helpful, thanks for all this information.
ReplyDeleteASP.Net Training in Delhi
This blog is full of Innovative ideas.surely i will look into this insight.please add more information's like this soon.
ReplyDeleteHadoop Training in Chennai
Big data training in chennai
Big Data Course in Chennai
JAVA Training in Chennai
Python Training in Chennai
Selenium Training in Chennai
Hadoop training in chennai
Big data training in chennai
big data course in chennai
very good post keep updating for more information
ReplyDeletePet Training | Petboro | Petcart Nest
I am commenting to let you know what a terrific experience my daughter enjoyed reading through your web page. She noticed a wide variety of pieces, with the inclusion of what it is like to have an awesome helping style to have the rest without hassle grasp some grueling matters.
ReplyDeleteSurya Informatics
very nice...
ReplyDeleteinplant training in chennai
inplant training in chennai for it
Bermuda web hosting
Botswana hosting
armenia web hosting
dominican republic web hosting
iran hosting
palestinian territory web hosting
iceland web hosting
Bermuda web hosting
ReplyDeleteBotswana hosting
armenia web hosting
lithuania shared web hosting
inplant training in chennai
inplant training in chennai for it
suden web hosting
tunisia hosting
uruguay web hosting
This blog is the general information for the feature. You got a good work for these blog. oracle training in chennai
ReplyDeleteSuch a great blog.Thanks for sharing...
ReplyDeleteDevOps Training in Bangalore
Devops Training in Pune
Devops Training in Hyderabad
Devops Training in Gurgaon
Such a great blog. Thanks for sharing
ReplyDeletepython training institute in chennai
Happy to read the informative blog. Thanks for sharing
ReplyDeleteIELTS Coaching Center in Chennai
best ielts coaching centre in chennai
Such a good post .thanks for sharing
ReplyDeletePython Training in Porur
Python training in chennai
Great post. keep sharing such a worthy information.
ReplyDeleteSalesforce Training in Chennai
salesforce training online
Thank you for this blog. Share more like this.
ReplyDeleteIELTS Coaching in Chennai
IELTS Online Classes
IELTS Coaching In Bangalore