The Fundamental idea behind object-oriented language is to combine into a Single unit both data and the functions that operate on the data. Such unit is called an object.If you want to read a data items in an object then you have to call a member function (object function)in an object. it will read the Data item and return the value to you. you cannot access the data directly.So it is safe from accidental alteration. So data and its Function is said to be encapsulated into a single entity.
Lets us understand what is the Object, Object is a set of entities in a real world senario for example state is one of the object of class country, Where Maharastra,uttar pradesh, Andra pradesh etc are one the entities, and they collectively called an object stated as STATE, Another example Class room is the Class and Furneture, Students, Teachers Are different object, SO through this Example you can easily understand what the object is and What the class is all about.
So i terms of computer programming Language, Class is the collection of Data varables and Functions.
If you've never used an object-oriented programming language before, you'll need
to learn a few basic concepts before you can begin writing any code. This lesson
will introduce you to objects, classes, inheritance, interfaces, and packages.
Each discussion focuses on how these concepts relate to the real world, while
simultaneously providing an introduction to the syntax of the C++ programming
language