TET Ready

Lessons › PG TRB › Computer Science

C++ objects, lifetime and polymorphism

PG TRB Computer Science lesson in English and Tamil · ஆங்கிலம் மற்றும் தமிழில்

C++ objects, lifetime and polymorphism

Constructors establish object state; access control defines permitted interfaces. Overloads depend on parameter signatures.

Virtual calls use dynamic object type. Copying a derived object into a base value slices it; references and pointers behave differently.

Resource ownership and destruction matter during normal exits and exception unwinding. A moved unique_ptr transfers unique ownership.

A simple example

An int& parameter can update the caller’s integer, unlike a separate int value parameter.

C++ பொருட்கள், வாழ்நாள் மற்றும் பல்லுருவாக்கம்

உருவாக்கிகள் பொருளின் நிலையை நிறுவும்; அணுகல் கட்டுப்பாடு இடைமுகத்தை வரையறுக்கும். மிகையேற்றம் அளவுருக் கையொப்பத்தைச் சாரும்.

மெய்நிகர் அழைப்பு இயக்கநிலை வகையைப் பயன்படுத்தும். தருவித்ததை அடிப்படை மதிப்பாக நகலிட்டால் துண்டிக்கப்படும்; குறிப்பு, சுட்டி வேறு.

இயல்பான வெளியேற்றம், விதிவிலக்கு மீளலில் வள உரிமையும் அழித்தலும் முக்கியம். நகர்த்திய unique_ptr தனி உரிமையை மாற்றும்.

ஒரு எளிய எடுத்துக்காட்டு

int& அளவுரு அழைப்பாளரின் முழு எண்ணை மாற்றலாம்; தனி int மதிப்பு அளவுரு வேறு.

Practise this topic · பயிற்சி செய்யுங்கள்

Try free PG TRB questions with explanations in the TET Ready app.

Open in TET Ready · திறக்கவும்

Original study material for practice. TET Ready is an independent study aid and is not connected with the Teachers Recruitment Board (TRB) or the Government of Tamil Nadu. Terms and privacy