Web Hosting Forum | Lunarpages

Author Topic: Object and a class  (Read 5444 times)

Offline android45

  • Spaceship Captain
  • *****
  • Posts: 110
Object and a class
« on: October 30, 2012, 12:46:14 AM »
I would like to know what is the difference between an object and a class? Please explain in detail.

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6187
Re: Object and a class
« Reply #1 on: October 30, 2012, 05:45:49 AM »
A class is more or less a template describing data and methods to apply to it. An object is an instantiation of a class, creating an actual instance of data to work with (call its methods).
Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-

Offline annaharris

  • Spacescooter Operator
  • *****
  • Posts: 48
    • PHP Development Comapny
Re: Object and a class
« Reply #2 on: April 23, 2013, 04:12:40 AM »
Every instance of a class is an object.
Classes are not objects. They are types. For getting more ideas about this, you can refer below link, http://www.felgall.com/obj1.htm

Offline ivvyevents

  • Spaceship Captain
  • *****
  • Posts: 104
Re: Object and a class
« Reply #3 on: July 02, 2013, 10:58:48 AM »
Object is an instance of class where class is simply template for objects. And class is consists of attributes and it doesn't change during the execution.

 

Share |