Powered by Blogger.

Difference Between Class and Object in C++



Difference Between Class and Object in C++


Hello friends Gaurav Rawat is here with new concept. Today we can see Difference Between Class and Object in C++. It is generally asked in any interview at fresher level.

Difference Between Class and Object in C++

Some Important difference between class and object


  • Object is an instance of a class. Class is a blueprint or template from which objects are created.
  • Object is a real world entity such as pen, laptop, mobile, bed, keyboard, mouse, chair etc. Class is a group of similar objects.
  • Object is created many times as per requirement. Class is declared once.
  • Object allocates memory when it is created. Class doesn't allocated memory when it is created.
  • Object is a physical entity. Class is a logical entity.


Object is created through new keyword mainly e.g.
Student s1=new Student();

 Class is declared using class keyword e.g.

class Student{}



facebook
google-plus
twitter
pinterest

No comments :

Post a Comment

HTML Tutorial

images

About Sitesbay

This blog is related to Java Tutorial, C++ Tutorial, C Tutorial, Online Earning tips and more in very simple and easy way. Here i will try to give complete idea related to all new technology.

Java Tutorial

Java is Object oriented programming language, It is more secure and high performance language.

C++ Tutorial

C++ is also Object oriented programming language, It is more simple and easy to learn.

 
https://sitesbay.blogspot.com/?utm_medium=d2898efa59afcc0bc411921036e22b767ca37b09