Results 1 to 5 of 5

Thread: Differentiation between C++ object and instance

  1. #1
    Join Date
    Dec 2009
    Posts
    38

    Differentiation between C++ object and instance

    Hi friend,

    I am learning the C++ programming language. This programming language seems quit complex than C programming. I know it is a object oriented language. I want to be aware about the differences between the objects and instances in C++ language. If you knows the these differentiation about the C++ object and instance, then please let know that. I am waiting for your reply.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Differentiation between C++ object and instance

    In C++ the class is nothing but the structure of an object. It means the objects define the structure of the class in object oriented programming. In other word the object is works like the result of the class of program. It is the special instance of the class. The object is used for to access the variable of the same class or outside class. If you to access the variable form the outside class then you need to create the object of that class.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Differentiation between C++ object and instance

    An instance is the individual object from the specific class. The every class instance comprises various values and which are assigns to it's instance variable. In object oriented programming there is only one to access the instance or variable of the class, and it is to use the object. It is mandatory to create the object of any class before get access to it's instances as well as the to the variables.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Differentiation between C++ object and instance

    Hi friend,

    Following is the example of object:

    Code:
    Class DMP
    {
    
    puplic static void main(String angs[])
    {
    
    DMP bhj= new DMP;// bhj object created
    
    DMP brt= new DMP;
    
    }
    }

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Differentiation between C++ object and instance

    An object is entity which is relates to the behavior ans state of the class in which it is defined. If you want to access the some method of class then you mus need to declare the the object to achieve this task. If you tried to use the method without instantiating the object then will definitely get an compilation error. It means object is the most iportant entity if the object oriented programming.

Similar Threads

  1. Replies: 6
    Last Post: 06-06-2011, 01:34 AM
  2. Replies: 3
    Last Post: 08-01-2011, 06:20 AM
  3. Differents between object and static object
    By Sarfaraj Khan in forum Software Development
    Replies: 5
    Last Post: 29-01-2010, 01:11 PM
  4. Object reference not set to an instance of an object
    By KAIRU26 in forum Software Development
    Replies: 3
    Last Post: 05-09-2009, 08:14 PM
  5. Replies: 5
    Last Post: 02-03-2009, 09:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,892,265.72913 seconds with 17 queries