PropellerAds
Posted by : Unknown Thursday, 9 October 2014

Introduction to object oriented programming.
Basically all the programming languages are of two types either:
·         Structured Oriented or
·         Object Oriented.
Today most of the languages used are object oriented like java as2.0,  as3.0 and C++.
So the question arises when we say object oriented programming what we mean by it or what is object oriented programming. This topic will clear the basic the idea and introduce you to the basic concept of it.
Object Oriented Programming.
In object oriented programming we make different objects, give them some instance names, and then call them by their instance name to change some of their attributes to perform a function.
Didn’t Understand??
This example will make the idea clear.
Suppose we created a robot as shown below.



We will select this robot and make this an object. Now the next step is to give it a name that is instance name. We can give any instance name to it with some restriction which I may explain in any other post. So , suppose any name for example we gave this robot instance name of robo . Now in our programming if we want the robot to do anything we can simply call it by its instance name robo.
Our object will have some attributes like its position from x axis, y axis, its rotation and many other. Suppose we want to move robot forward when we press right key. We can do this by revealingly increasing its distance from x-axis.
So our pseudo-code or general algorithmic form for that will be

While (right key){
robo x-axis increase by 1
}  


So in this example we are calling an object and changing its attributes to do required task this type of programming is called object-oriented programming.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

PropellerAds
PropellerAds

Popular Post

Powered by Blogger.

- Copyright © BSCS -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -