Back-End Programming Exam  >  Back-End Programming Videos  >  Learn to Program with C++: Beginner to Expert (in Hindi)  >  153. Rules and Limitation of Virtual Function in C++ (Hindi)

153. Rules and Limitation of Virtual Function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

186 videos

FAQs on 153. Rules and Limitation of Virtual Function in C++ (Hindi) Video Lecture - Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

1. वर्चुअल फंक्शन के क्या नियम और सीमाएं हैं?
उत्तर: वर्चुअल फंक्शन के नियम और सीमाएं निम्नलिखित हैं: - वर्चुअल फंक्शन केवल कक्षा के एक सदस्य फंक्शन के रूप में घोषित किए जा सकते हैं। - वर्चुअल फंक्शन को अवकलित अद्यावधिक की जाने वाली फंक्शन के रूप में परिभाषित किया जा सकता है। - एक वर्चुअल फंक्शन को उसकी विरासत वाली कक्षा में दोबारा घोषित करने की आवश्यकता नहीं होती है। - वर्चुअल फंक्शन को सदस्य फंक्शन के रूप में घोषित करने के लिए उसे एक धोखा देने वाली फंक्शन के रूप में परिभाषित किया जाना चाहिए। - वर्चुअल फंक्शन को अद्यावधिक करने के लिए इसे उसकी विरासत वाली कक्षा में दोबारा घोषित किया जाना चाहिए।
2. वर्चुअल फंक्शन क्यों जरूरी होते हैं?
उत्तर: वर्चुअल फंक्शनों का महत्वपूर्ण उपयोग निम्नलिखित कारणों से होता है: - ये पॉलिमॉर्फिज्म को संभव बनाते हैं, जिसके द्वारा एक ही नाम के फंक्शन को विभिन्न तरीकों से व्यवस्थित किया जा सकता है। - वर्चुअल फंक्शन की मदद से अद्यावधिक अधीनस्थ फंक्शनों को बनाने में सुविधा मिलती है, जिससे इस्तेमालकर्ता को फंक्शन को ओवरराइड करने की आवश्यकता नहीं होती है। - वर्चुअल फंक्शन के उपयोग से आप एक बेस कक्षा में विभिन्न विरासतवान कक्षाओं के एक समूह के लिए एक ही अद्यावधिक फंक्शन बना सकते हैं।
3. वर्चुअल फंक्शन कैसे कार्य करते हैं?
उत्तर: वर्चुअल फंक्शनों के कार्य को निम्नलिखित चरणों में व्यवस्थित किया जाता है: - वर्चुअल फंक्शन को वीर्चुअल कीवर्ड के साथ घोषित किया जाता है। - जब किसी विरासतवान कक्षा का ऑब्जेक्ट बनाया जाता है, तो कॉम्पाइलर वार्चुअल फंक्शन की वर्चुअल टेबल में इसे दर्ज करता है। - जब किसी सामान्य फंक्शन को विरासतवान कक्षा के ऑब्जेक्ट के साथ कॉल किया जाता है, तो सबसे पहले वर्चुअल टेबल से उस फंक्शन का ठिकाना ढूंढ़ा जाता है। - उसके बाद, वर्चुअल टेबल में ठिकाना प्राप्त करने के बाद, उचित फंक्शन को कॉल किया जाता है।
4. वर्चुअल फंक्शन को कैसे ओवरराइड किया जाता है?
उत्तर: वर्चुअल फंक्शन को ओवरराइड करने के लिए निम्नलिखित चरणों का पालन किया जाता है: - वर्चुअल फंक्शन को विरासतवान कक्षा में से एक अद्यावधिक कीवर्ड के साथ घोषित किया जाना चाहिए। - अद्यावधिक फंक्शन को बेस कक्षा की पूर्वनिर्धारित वर्चुअल फंक्शन के संदर्भ में लिखना चाहिए। - अद्यावधिक फंक्शन के पैरामीटर, वापसी
186 videos
Explore Courses for Back-End Programming exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

mock tests for examination

,

Important questions

,

Extra Questions

,

Semester Notes

,

153. Rules and Limitation of Virtual Function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

ppt

,

Free

,

practice quizzes

,

Objective type Questions

,

study material

,

Sample Paper

,

Exam

,

past year papers

,

Previous Year Questions with Solutions

,

video lectures

,

Viva Questions

,

pdf

,

Summary

,

shortcuts and tricks

,

153. Rules and Limitation of Virtual Function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

153. Rules and Limitation of Virtual Function in C++ (Hindi) Video Lecture | Learn to Program with C++: Beginner to Expert (in Hindi) - Back-End Programming

,

MCQs

;