Sri Chandra
what is the difference between class and objects?
By Sri Chandra in ASP.NET on May 14 2010
  • Umar Ali
    Sep, 2012 1

    Please refer to the following URL to know the differences between Class and Object,http://onlydifferencefaqs.blogspot.in/2012/07/oops-difference-faqs-2_11.html

    • 0
  • preetham ka
    Jun, 2010 7

    Class is a collection of Objects, and object is an instance of a Class.

    • 0
  • Jaish Mathews
    May, 2010 22

    Hi,

    If you have sub class version method too, then need to elaborate the design by adding one interface which will hold all of your such methods, like below. This design can apply to any of your sub class by just implementing this interface.

    public class MyAbstractChild : MyAbstract,ICommon

    {

    public void CallMyAbstractMethod()

    {

    //Subclass version will be called

    ICommon obj = new MyAbstractChild();

    obj.MyAbstractMethod();

     

    //Main abstract class version will be called

    MyAbstract obj1 = new MyAbstractChild();

    obj1.MyAbstractMethod();

    }

    public new void MyAbstractMethod()

    {

    Console.WriteLine("I am abstract child");

    }

    }

    public abstract class MyAbstract : ICommon

    {

    public void MyAbstractMethod()

    {

    Console.WriteLine("I am abstract");

    }

    }

    public interface ICommon

    {

    void MyAbstractMethod();

    }

     

     

     

    • 0
  • kiran adhLAKHA
    May, 2010 20

    CLASS  is a user defined data type  and store in heap.   two types of data type value types and reference typew .  in value types stored in stack and when we defined user defined data type it actually store the memory address. and  classes gives resuablity security  and code access security.

    and when we create the  class when we declare object memory is allocated to this variable. so when we create the class of an object it is object is instiated by new operator.

     

    • 0
  • May, 2010 20

    A class is basically a definition, and contains the object's code. An object is an instance of a class.

    • 0
  • Manas Ranjan Dash
    May, 2010 19

    A Class is collection of attributes(fields) and methods and this methods works on the data. The enitre class is encapsulated and is represented as a single unit. But again Class is a model only that describes about how class methods works on the class attributes.

    When this class takes the shape of  a real world thing, that time we say the class exists and we called it as Object. So Objects are real life implementation or programmatically instatiation of the Class.

    For Example, Shape may be a class and Triange and Square are objects. We can take "Side" as a field and "Area" as a method. So Area takes the Side and calculates the Area of that particular shape.

    • 0
  • mubashir hafeez
    May, 2010 19

    Class is blueprint and Object is the living instance of class.

    • 0
  • Hirendra Sisodiya
    May, 2010 18

     class is an abstract description of a set of objects,and Object is an instance of class...

    • 0
  • Deepak Pandey
    May, 2010 17

    Class is conceptual thinking about real world entity whereas object is a physical existence. Ex.
    Person is a class and I am the object of person class I have all the properties and behavior of person class.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS