Bringing it all together...

This document was written by CS 290W TA Joshua Kay and was last modified

So, Object Oriented Programming can be viewed as Objects + Classes + Inheritance

We need to discuss the difference between Classes and Instances of those classes

If we have a Frog class, it is merely a class which defines a generic frog

However, it does not define any specific frog

In other words, the Frog class can be thought of as a generic template to create new frogs

Frog kermit=new Frog();

kermit is now an instance of class Frog. We can tell kermit to jump, to ribbit, to eat a fly

We can say kermit.jump() - we CANNOT say Frog.jump()

Dog spot=new Dog();

We can say spot.bark() - but we CANNOT say Dog.bark()

You can tell your dog to speak, but you can't make the definition of a dog speak

-----------------

We have to learn to think in terms of Objects, and how they relate