What is Class and object, How to declare object in c++ oop, Example of class, object and attributes

What is Class and object, How to declare an object in c++ oop, Example of class, object and attributes

In this tutorial, we will learn about the followings;

  1. What is a class?
  2. What is an object?
  3. What are attributes?
  4. Examples of object and attribute.
  5. How to declare a class?

What is a class?

A class is a big and generalized concept having attributes, functions, and objects.

What is an object?

An object can be any person, thing, place or an event etc.

What is an attribute?

Attributes are the properties of classes.

 

Example of class, object and attributes:

Class: Furniture

Object : Chair, Table etc

Attributes: Chair color, Chair price, Table size etc.

Functions : Add_Table, View_Table, Delete_Table, Update_table etc.

How to declare a class?

Line#Code
1class furniture
2{
3body of the class
4};

Line 1: Class is keyword and furniture is the class name.

Line 2: Starting body of the class

Line 3: Body of the class where we write attributes and functions of the class.

Line 4: Ending of the class.

Please Share This Article with Friends
Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....
https://web.facebook.com/groups/2066136233601097/