Lesson 15 of 24
Classes மற்றும் ObjectsClasses and Objects
10 min 30 XP
Class ஒரு வரைபடம்: data members மற்றும் member functions. private உறுப்புகளை class-க்கு வெளியே அணுக முடியாது (encapsulation); public methods மூலம் மட்டும்.
A class is a blueprint with data members and member functions. private members can't be touched from outside the class (encapsulation); public methods are the way in.
Example: edit me and press Run
Press Run to see the result here.class-ல் உறுப்புகள் இயல்பாக private; struct-ல் இயல்பாக public. இதுதான் C++-ல் class vs struct-ன் ஒரே வேறுபாடு.
Members of a class are private by default; members of a struct are public by default. That's the only difference between them in C++.