GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 233 of 258    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.

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.

   

   



Above answer was rated as good by the following members:
tanzeem khan, sireesha.perla, abswarup
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 | NoAnswer is useful 3   Answer is not useful 0Overall Rating: +3    

 Related Questions

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 ...

Explain "passing by value", "passing by pointer" and "passing by reference"
Tags : Pointer

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

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 ...

Latest Answer :  there is no way to process an entire string.it has to be done char by char ...

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 ...

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

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

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

Can we call constructor of superclass directly without using super()method in subclass? if yes,explain,if no,why?


 Sponsored Links

 
Related Articles

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960’ s The term object oriented programming’ was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

Explain about TNSPING

You can also use tnsping utility on command prompt to check Oracle Net connectivity. Follow these steps to check the connection to particular SID. Open Command prompt. Write tnsping < SID for the database connectivity you want to check > If you get the message “Used TNSNAMES
 

The Inheritance Concept In OOPs

The Inheritance Concept In OOPs In object oriented programming objects will be characterised by classes It is possible to learn a lot about an object based on the class it belongs to Even if you are not familiar with the name Maybach If I told you it is a car you would immediately know that it has f
 

Understanding The Message Concept In OOPs

Understanding The Message Concept In OOPs To understand object oriented programming you will need to become familiar with messages As the name implies a message is a process in which software objects will communicate with one another Because of this having one object is not enough mosgoogle An objec
 

Basic concepts of OOPS and Structure of C++ program

Basic concepts of OOPS and Structure of C program In this tutorial you will learn about Objects Classes Inheritance Data Abstraction Data Encapsulation Polymorphism Overloading Reusability Before starting to learn C it is essential that one must have a basic knowledge of the concepts of Object orie
 

Adapting To The Real World After College

Adapting To The Real World After College College students often get so wrapped up in the education process that they cannot see beyond their schooling and this can be a costly mistake While the education process is important you need to keep your eye on the prize which is a great job that you believ
 

Staying Afloat In The Changing IT World

Staying Afloat In The Changing IT World Jobs in the IT or information technology field almost always guarantee decent salaries constant work and an interesting work environment so they are attractive to many college graduates Unfortunately the longer you work in the IT field the more you’
 

Technical Terms Used in Testing World

Technical Terms Used in Testing World In this tutorial you will learn about technical terms used in testing world from Audit Acceptance Testng to Validation Verification and Testing mosgoogle Audit An independent examination of a work product or set of work products to assess compliance with specifi
 

Developing and Testing a Complete "Hello World" J2EE Application with WSAD 5.0

This tutorial uses WebSphere Studio Application Developer Version 5 0 to develop test run and debug a complete J2EE application consisting of entity and session EJBs a servlet a JSP page and an HTML home page Focusing extensively on EJB development the entire application will use only the Applicatio
 

The World of Business Communication

The World of Business Communication Every business’ s aim is to gain profits. Whatever be the type of business you are in; the bottom line is that you must earn something from it. There is no businessman in this world who wants to lose money everyday if they do their business will definit
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

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

Page copy protected against web site content infringement by Copyscape