5 replies
by thechas
Not necessarily an answer.
Have you looked at TR's sister site
www.builder.com.com
A while back, TR split off the programming language content to a separate site.
I subscribe to some of their e-mails, and recall a series of articles on OOP (Object Oriented Programming.
I find most of the articles are clearly written and easy to understand.
Chas
by rawright
This site may give some clues: http://personal.cityu.edu.hk/~ismikeho/dm2/som.htm
The difference between an object class and an instance is much simpler - the class is a definition of a type of object, much like a struct defines the layout of a section of memory for data. You can't use either until you create an instance of it in a program. For example:
class foo{
int x;
int getx(){
return x;
}
int setx(int i){
x=i;
}
}
defines a class, foo. It isn't useful for anything until you instantiate it:
void main(){
foo f;
int i;
f.setx(3); // Sets x = 3 in f
i=f.getx() // Returns 3 into i
}
The class is foo; f is an instance of class foo.
Think of it this way
A object class is like the plans for a house
and object instance is like the actual house based on the plans
from one object class you can create many object instances. Just like you can make many identical houses from one set of plans
Think of it this way
A object class is like the plans for a house
and object instance is like the actual house based on the plans
from one object class you can create many object instances. Just like you can make many identical houses from one set of plans
by tonymeacham
Object-Oriented Computing - What's the Big Deal?
In this article, we'll provide a brief overview of the main concepts of object-oriented computing
-First Step Communications
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending