Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Objects and Classes

Objects and Classes

Ratings: (0)|Views: 7|Likes:
Published by sanbioinfo
this presentation presents the very basic concepts of Objects and Classes which are very basic terminologies in the Object Oriented Programming concept....... I hope it might be useful to understand the basic concepts of OOP that is Object and Class relation.........
this presentation presents the very basic concepts of Objects and Classes which are very basic terminologies in the Object Oriented Programming concept....... I hope it might be useful to understand the basic concepts of OOP that is Object and Class relation.........

More info:

Published by: sanbioinfo on Dec 16, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPTX, PDF, TXT or read online from Scribd
See more
See less

06/01/2013

pdf

text

original

 
So what is an object ?
Anobjectisacomponentofaprogramthatknowshowtoperformcertainactionsandtointeractwithotherpiecesoftheprogram.Aprogramcanbebrokendownintospecificparts,andeachofthesepartscanperformfairlysimpletasks.Whenallofthesesimplepiecesaremeshedtogetherintoaprogram,itcanproduceaverycomplicatedandusefulapplication.
So what is OOP ?
Or in a simple way 
object
is a user defined variable of type
class
 
//
demonstrates a small, simple object
#
include <iostream.h>
#
include <conio.h>class smallobj//define a class{private:intsomedata;//class datapublic:void setdata(intd) //member function to set data{somedata= d;}void showdata()//member function to display data{cout<< "Data is " << somedata<< endl;}};intmain(){clrscr();smallobjs1, s2;//define two objects of classsmallobjs1.setdata(1066);//call member function toset datas2.setdata(1776);s1.showdata();//call member function todisplay datas2.showdata();getch();}
 
//
objpart.cpp
#
include<iostream.h>
#
include<conio.h>class part//define class{private:intmodelnumber;//ID number of widgetintpartnumber;//ID number of widget partfloat cost;//cost of partpublic:void setpart(intmn, intpn, float c)//set data{modelnumber= mn;partnumber= pn;cost = c;}void showpart()//display data{cout<< "Model " << modelnumber;cout<< ", part " << partnumber;cout<< ", costs $" << cost << endl;}};void main(){clrscr();part part1;//define object// of class partpart1.setpart(6244, 373, 217.55F);//callmember functionpart1.showpart();//call member functiongetch();}

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->