Objects

Say we have a ball. A ball is an object. A ball has properties such as color, size, weight. You can have actions associated with the ball such as throwing, catching, kicking. You can have a bunch of balls with all the same actions but not all the same properties. The same is true with objects in programming. When we talk about objects in programming, they are modeled after real world objects. The pseudocode for creating a ball would be:
OBJECT BALL
ACTIONS:
KICK
THROW
CATCH
PROPERTIES:
COLOR
SIZE
WEIGHT

MAIN PROGRAM
  NEW BALL
END MAIN


Notice that the NEW command tells everyone that you are creating a NEW BALL, and not using one that is already made. Objects can get confusing if you aren't familiar with them and how they apply to programming, so let's take an object that everyone should be familiar with.

The button has properties, or attributes to it such as background clor, text color, what the button says. This object only has one action though, push. You may come across programs with multiple objects that each have literally hundreds of actions.

Back to Index
Twitter








Link Directory | link directory | GeekySpeaky: Submit Your Site! | Blog Matter

Copyright © 2004-2017 Sean Noble, All rights reserved
Read our Disclosure Policy