seriously..the textbook authors hav eno idea what OOP is.
well not u sam davis but other authors...
Firstly,
Object is an instance of class.
So
Class could be "Human"
then an instance of that class, hence Human object could be "Tim"
The object tim has all the characteristic of Human, as it IS a Human class.
Sunny's eg of Driver is quiet misleading IMO.
That is more of inheritance concept.
What you can do is, u make a new class "base on" a different class. So you can make a class called driver based on the class Human. this makes sense cuz All drivers are human. But not all human are drivers.
You can then add methods and properties that are unique t each new classes such as method drive() for driver and cook() for cook. BUT THEY WILL ALL Have methods and properties of Human class. EG, eat(), sleep() etc
There can be many different class with one base. So, driver, cook, iptteachers/morons, sddteachers/less morons, chemteachers etc
Now that called inheritance.inheritting a class to make a new class
Now... Polymorphism.
When you program using objects..there are times when u wanna treat drivers, cook etc as on tpye.reason could be that u wanna make a collection of humans. Then what u can do is treat, driver
as a human class/object. althuogh u loose all the unique methos and properties of the class but u can treat them all like human and its easier to handle the data..and programming becomes simple. you really need to try this in ur own program to see its benefit..
did this help?
Concept of events are something that have been built using the OOP languages. It is nothing more than an array of commands.
When an event is some how invoked, it runs thru that list of commands.
Events are really invoked like a fuction, and is invoked within the objects so you won't know exactly how it is invoked or when it is invoked other than from its name, eg. "OnSleep()". u can probably guess that the event is called when Sleep() method is executed.
When you have an event handler, you are registering commands to that array of commands i spoke abut b4.
So technically u can have 50 event handlers for one event. And u can do this with c# and other oop languages.
VB is not an oop cuz it does'nt have
polymorphism,inheritance.