sir last time you gave clarification for abstraction.thank you.
now my question is again abstraction.i do not know whether this doubt is correct or not.but i am asking you.
suppose i write the code like this
cout<<"enter roll no"<<endl;
in this programme how can i expect abstraction.which details are hidden?which are essential features?how many of them are shown?please tell.
I would say that the student class is an abstraction of a real living student because it reduces the details of the real student down to only the details important to the computer program. That is one way of looking at it.
The age and rollnumber are hidden and and accessed only by the member functions read and show. That is called data hiding, but also helps in abstraction because it hides implementation.
Note that storing age is not such a good idea because age is always changing. It is better to store birthdate and calculate age when needed.