CLASS - Object-Oriented Progr……
CLASS – Object-Oriented Programming (OOP)
Class என்பது objects-ஐ உருவாக்க பயன்படும் ஒரு user-defined data type / blueprint / template ஆகும். ஒரு class-க்குள் பொதுவாக: Data / Variables Functions / Methods Access control இவை அனைத்தையும் ஒரே unit-ஆக சேர்த்து வைத்திருக்கலாம். Simple D…
Class என்பது objects-ஐ உருவாக்க பயன்படும் ஒரு user-defined data type / blueprint / template ஆகும். ஒரு class-……
ஒரு House Plan எடுத்துக்கொள்ளுங்கள். House plan-ல்: Bedroom எத்தனை? Kitchen எங்கே? Door எங்கே? Window எங்கே? ……
இது Student என்ற blueprint. அதிலிருந்து: ……
Programming-ல் ஒரு student பற்றி store செய்ய வேண்டுமென்றால்: Name Roll Number Age Mark மற்றும் அவருக்கான oper……
ஒரு class பொதுவாக இரண்டு முக்……
Data Members
Class-க்குள் declare செய்யப்படும் variables. int ro……
Member Functions
Class-க்குள் declare அல்லது define செய்யப்படும் fu……
Class concept-ஐ இந்த flow மூலம் நினைவில் வைத்துக்கொள்ளுங்கள்: Class ↓ Bluepr……
Student Class ↓ name, mark ↓ displa……
data_members; member_function……
int mark;…
Class definition முடிவில்: };……
TRB / Interview MCQ-ல் இது மு……
int mark;…
s1.mark = 90; s1.display(); r……
Example: class Student { }; S……
Consider: Class = Car Car class properties: brand colour speed price Methods: start() stop() accelerate() Obj……
Class என்பது structure/blueprint definition. Object உருவாக்கும்போது: Student s1; s1-க்கான data members-க்கு m……
1. private 2. public 3. prote……
private members class வெளியில……
int mark; }; Wrong: Student s……
PUBLIC
public members class வெளியிலி……
int mark; }; Then: Student s1……
PROTECTED
protected members: Outside code-ல் normally direct access செய்ய முடியாது. Derived classes-ல……
இங்கே x automatically: private member ஆகும். இந்த point MCQ-ல் அடிக்கடி கேட்கப்படும். CLASS AND E……
int balance; public:…
இங்கே: balance மற்றும் deposit(), withdraw() ஒரே class-க்குள் encaps……
int mark; void display(); };…
s1.mark = 95; s1.display(); return 0; } SCOPE RESOLUT……
Student class-க்கு சேர்ந்த display() function NESTED UNDERSTANDING void Student::display() பிரித்து பார்ப்போம……
Suppose: public: int balance; என்றால் எந்த code-மும்: account.balance = -50000; என்று ……
இதனால் data பாதுகாப்பாக இருக்கும். இதுதான் data hiding idea. CLASS FEATURES Class மூலம் நாம் முக்கியமாக பெறுவ……
இங்கே: Student ஒரு user-defined data type. அதனால்: Student s1; என்பது: int x; போன்ற declaration concept. Comp……
இது mobile object கிடையாது. இது mobile object உருவாக்குவதற்கான specification. Actu……
int salary; public:…
Here: salary → Data member displaySalary() → Member function STATIC MEMBER - BASIC……
Normal data member → One copy per object Static data member → One common copy for the entire cl……
Then: Student s1; Object created ஆனவுடன் constructor automatically call ஆகும். DESTRUCTOR CONNECTION Object……
Structure vs Class in C++ ஒரு முக்கிய MCQ: C++……
x → private. But: struct A { ……
Class குறித்து கண்டிப்பாக நினைவில் கொள்ள வேண்டிய points: Class is a user-defined data type. Class is a bluepr……
Missing semicolon Wrong: clas……
Accessing private member directly c……
Forgetting object name Wrong:……
Wrong member access Wrong: s1……
C → Class B → Blueprint O → Object I → Instan……
TRB Important Facts Question: What is a class? Answer: A user-defined data type that acts as a blueprint for ……
Interview-ல்: "What is the difference between class and object?" Answer: A class is……
A class in C++ is a:…
An object is:…
Default access specifier of a……
Which operator accesses a mem……
Which operator is the scope r……
A class definition normally e……
Variables declared inside a c……
Functions belonging to a clas……
Consider: class Employee { private: int salar……
CLASS | |-- User-defined data type | |-- Blueprint for objects | |-- Data Members | |-- Member Functions | |-……
Class என்பது Object-Oriented Programming-ன் அடிப்படை building block. ஒரு object-க்கு தேவையான data members மற்……