Você está na página 1de 4

OOPS - Explain OOPs,With real world examples http://www.geekinterview.

com/question_details/33168

Home | Tech FAQ | Interview Questions | Placement Papers | Tech Articles | Learn | Freelance Projects | Online Testing | Geeks Talk | Job Postings | Knowledge Base | Site Search | Add/Ask Question

GeekInterview.com > Tech FAQs > OOPS Sponsored Links

Go To First | Previous Question | Next Question


OOPS | Question 233 of 257 Print
Explain OOPs,With real world examples

Total Answers and Comments: 1 Last Update: August 31, 2006 Asked by: kalps

Sponsored Links

Best Rated Answer —

Submitted by: Linto

OOPs is Object Oriented Programming.The great thing about OOPs is that is all about classes and objects
which can easily correlated with real life scenarios.

Class is the general thing and object is the specilisation of general thing

For example if Human can be a class and linto ,raj etc are names of persons which can be considered as
object.It supports concepts such as data abstation,inheritence ,polymorhpism etc. Related Categories —

Data Abstration is the process of encapsulating data with in object so as to protect data and to avoid
unwanted access(You know now the age of information explosion ,so giving proper data has greater Abinitio FAQs
significance) AJAX FAQs
So for our example every human has eye ,so eyecolor can be considered as the property of human Concepts FAQs
being which can be encapsulted as a data in our class Human Data Warehousing FAQs
class Human Database FAQ
DataStage FAQ
{
Informatica FAQ
private:
LoadRunner FAQ
EyeColor IColor; Lotus Notes FAQ

NAME personname; Mainframe FAQs


Networking FAQ
};
OOPS FAQ
Consider object of class of
Operating System FAQ
Human myhuman; Oracle FAQs

we want set myhuman's name as "linto" and IColor as "black" Oracle Apps FAQs
PeopleSoft FAQs
For that we want methods to do that task.
PL/SQL FAQ
So need methods for class to do a particular task on the data Programming Faqs
class Human QTP FAQ
Rational Robot FAQ
{
RDBMS FAQs
private:
SAP R/3 FAQs
EyeColor IColor; Scripting FAQs
NAME personname; Siebel FAQ
SilkTest FAQs
public:
Oracle SQL FAQ
void SetName(NAME anyName);
SQL Server FAQs
void SetIColor(EyeColor eyecolor); Test Director FAQ

}; Testing FAQs
Testing Definitions
So a class is a thing which has data members(normally properties of object) and methods to manipulate
that data.But the thing to undersand is that class has propeties not any particular data.In other words Websphere FAQ
the Human class no specific IColor.Only when one object of that class (myhuman) has name "linto" and WinRunner FAQ
IColor "black".

Next we can go through the concept of inheritence which has the same as the word meaning as u all
aware.

Human

____|_____

| |

1 of 4 6/20/2009 11:39 AM
OOPS - Explain OOPs,With real world examples http://www.geekinterview.com/question_details/33168

/ /

Men Women

Here Human is general class and Man and Women are sub classes of general thing.That is Human class
contains all features general and Human and Women contains features specific to their own class.

Hey try to write class ...you will get the essence of OOPs.

Above answer was rated as good by the following members:


tanzeem khan

August 31, 2006 03:30:05 #1


Linto

RE: Explain OOPs,With real world examples

OOPs is Object Oriented Programming.The great thing about OOPs is that is all about classes and objects
which can easily correlated with real life scenarios.

Class is the general thing and object is the specilisation of general thing

For example if Human can be a class and linto raj etc are names of persons which can be considered as
object.It supports concepts such as data abstation inheritence polymorhpism etc.

Data Abstration is the process of encapsulating data with in object so as to protect data and to avoid
unwanted access(You know now the age of information explosion so giving proper data has greater
significance)

So for our example every human has eye so eyecolor can be considered as the property of human being
which can be encapsulted as a data in our class Human

class Human

private:

EyeColor IColor;

NAME personname;

};

Consider object of class of

Human myhuman;

we want set myhuman's name as linto and IColor as black

For that we want methods to do that task.

So need methods for class to do a particular task on the data

class Human

private:

EyeColor IColor;

NAME personname;

public:

void SetName(NAME anyName);

void SetIColor(EyeColor eyecolor);

};

So a class is a thing which has data members(normally properties of object) and methods to manipulate
that data.But the thing to undersand is that class has propeties not any particular data.In other words the
Human class no specific IColor.Only when one object of that class (myhuman) has name linto and IColor
black .

Next we can go through the concept of inheritence which has the same as the word meaning as u all
aware.

Human

____|_____

||

//

Men Women

Here Human is general class and Man and Women are sub classes of general thing.That is Human class
contains all features general and Human and Women contains features specific to their own class.

Hey try to write class ...you will get the essence of OOPs.

Is this answer useful? Yes | No 1 0 Overall Rating: +1

Related Questions

2 of 4 6/20/2009 11:39 AM
OOPS - Explain OOPs,With real world examples http://www.geekinterview.com/question_details/33168

Explain the need for "Virtual Destructor".


Latest Answer : When classes are inherited, we need to make the base class destructor virtual – to make sure when
the object is destroyed, all the derived class destructors also called. Otherwise the derived class destructors are not
called because the there is compile ...
Read Answers (1)
Answer Question Subscribe

Explain "passing by value", "passing by pointer" and "passing by reference"


Explain "passing by value", "passing by pointer" and "passing by reference"
Read Answers (3)
Tags : Pointer
Answer Question Subscribe

Explain working of printf.


Latest Answer : The return type of the printf() function is 'int'. (lot of confusion surrounding the return type of printf
-- correct answer is 'int') ...
Read Answers (2)
Answer Question Subscribe

Give 2 examples of a code optimization.


Latest Answer : I am giving below another example of code optimization you can follow for C++ program. As we all
know prefix operators apply the operations of incrementing or decrementing as specified and the new value is stored.
In case of postfix operator the operations ...
Read Answers (2)
Answer Question Subscribe

Explain one method to process an entire string as one unit?


Latest Answer : there is no way to process an entire string.it has to be done char by char ...
Read Answers (1)
Answer Question Subscribe

What is polymorphism? Explain with an example.


Latest Answer : Polymorphism is the ability to assume many forms. In short it refers to several methods / operators
sharing the same name but having different parameter list and different implementations. Variables also can be
polymorphic. There are two ways polymorphism ...
Read Answers (1)
Answer Question Subscribe

I have just started doing OOP design. My experience has been in RDBMS.
Where we work with tables, relation
I have just started doing OOP design. My experience has been in RDBMS. Where we work with tables, relation
between them defined using foreign keys. Can anyone pl. help in designing classes for a simple case here. There are
two tables (states, districts). Districts contains stateId as foreign key. So state to district 1-many relation is there.
Such things how do we design in oops. Thanx in advance
Read Answers (2) | Asked by : sudha
Tags : RDBMS, OOPS
Answer Question Subscribe

What are the advantages of oops over traditional programming?


Latest Answer : OOPs is closer to real life representation of the objects which we want to program.Hierarchical
relationships can be represented using inheriatnce. Data can be divided as public and private -- also we can provide
interface for entering and validating ...
Read Answers (2) | Asked by : ritu
Tags : OOPS
Answer Question Subscribe

What is the purpose of friend function and is it overwhilmimg the private policy
of oops concept?
Latest Answer : A friend function can access all private protected and public data of a class. A class has to declare a
function or another class as a friend. Also the friendship is one way. Class A is friend of class B does not mean that
class B is friend of class A. ...
Read Answers (1) | Asked by : vasanthakumar
Tags : OOPS
Answer Question Subscribe

Can we call constructor of superclass directly without using super()method in


subclass? if yes,explain,if
Can we call constructor of superclass directly without using super()method in subclass? if yes,explain,if no,why?
Read Answers (4) | Asked by : lherwadkar
Answer Question Subscribe

Sponsored Links

Related Articles

3 of 4 6/20/2009 11:39 AM
OOPS - Explain OOPs,With real world examples http://www.geekinterview.com/question_details/33168

OOPS Tutorials Explain about TNSPING

Object oriented programming OOP is a computer science You can also use tnsping utility on command prompt to
term used to characterize a programming language that check Oracle Net connectivity. Follow these steps to
began development in the 1960’ s The term object check the connection to particular SID. Open Command
oriented programming’ was originally coined by prompt. Write tnsping < SID for the database
Xerox PARC to designate a computer application that connectivity you want to check > If you get the
describes the methodol message “Used TNSNAMES

The Inheritance Concept In OOPs Understanding The Message Concept In OOPs

The Inheritance Concept In OOPs In object oriented Understanding The Message Concept In OOPs To
programming objects will be characterised by classes It is understand object oriented programming you will need to
possible to learn a lot about an object based on the class become familiar with messages As the name implies a
it belongs to Even if you are not familiar with the name message is a process in which software objects will
Maybach If I told you it is a car you would immediately communicate with one another Because of this having one
know that it has f object is not enough mosgoogle An objec

Basic concepts of OOPS and Structure of C++


Adapting To The Real World After College
program
Adapting To The Real World After College College
Basic concepts of OOPS and Structure of C program In
students often get so wrapped up in the education
this tutorial you will learn about Objects Classes
process that they cannot see beyond their schooling and
Inheritance Data Abstraction Data Encapsulation
this can be a costly mistake While the education process
Polymorphism Overloading Reusability Before starting to
is important you need to keep your eye on the prize which
learn C it is essential that one must have a basic
is a great job that you believ
knowledge of the concepts of Object orie

Staying Afloat In The Changing IT World Technical Terms Used in Testing World

Staying Afloat In The Changing IT World Jobs in the IT or Technical Terms Used in Testing World In this tutorial you
information technology field almost always guarantee will learn about technical terms used in testing world from
decent salaries constant work and an interesting work Audit Acceptance Testng to Validation Verification and
environment so they are attractive to many college Testing mosgoogle Audit An independent examination of a
graduates Unfortunately the longer you work in the IT field work product or set of work products to assess
the more you’ compliance with specifi

Developing and Testing a Complete "Hello World"


J2EE Application with WSAD 5.0 The World of Business Communication

This tutorial uses WebSphere Studio Application The World of Business Communication Every
Developer Version 5 0 to develop test run and debug a business’ s aim is to gain profits. Whatever be the
complete J2EE application consisting of entity and session type of business you are in; the bottom line is that you
must earn something from it. There is no businessman in
EJBs a servlet a JSP page and an HTML home page
this world who wants to lose money everyday if they do
Focusing extensively on EJB development the entire their business will definit
application will use only the Applicatio

About Us | Privacy Policy | Terms and Conditions | Contact | Site Map | Add Question | Propose Category | RSS Feeds | Articles Sitemap | Site Updates | Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved

4 of 4 6/20/2009 11:39 AM

Você também pode gostar