Lecture 25 Interface in Java Hindi Video Lecture | Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

FAQs on Lecture 25 Interface in Java Hindi Video Lecture - Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

1. Interface क्या है और इसका उपयोग कैसे किया जाता है?
Ans. Interface एक blue-print होता है जिसमें मेथडों की डिफ़िनिशन लिखी जाती है लेकिन उन्हें इम्पलीमेंट नहीं किया जाता है। Java में, यदि किसी क्लास ने किसी Interface को इम्पलीमेंट किया है तो उसको वो सभी मेथड्स ओवरराइड करने होते हैं जो Interface में डिफ़िनिशन लिखी गई होती है।
2. Interface और Abstract Class में क्या अंतर होता है?
Ans. एक Interface में सभी मेथड्स abstract होते हैं और किसी भी वेबसाइट की वेब सर्विस को इस्तेमाल करने के लिए उन्हें ओवरराइड करना होता है। Abstract Class में भी abstract मेथड्स होते हैं लेकिन वे optional होते हैं, यानी वो ओवरराइड नहीं किए जा सकते हैं। इसके अलावा, एक क्लास में केवल एक Abstract Class extend की जा सकती है, जबकि एक क्लास में मल्टिपल Interface implement की जा सकती हैं।
3. Interface का उपयोग क्यों किया जाता है?
Ans. Interface का उपयोग करने के कई कारण हो सकते हैं: - एक क्लास में मल्टिपल इंहेरिटेंस की अनुमति नहीं होती है, लेकिन मल्टिपल Interface का उपयोग करके एक क्लास में अनेक Interfaces इम्पलीमेंट की जा सकती हैं। - Interface एक साधारण ब्लूप्रिंट प्रदान करता है जिसे किसी क्लास ने इम्पलीमेंट करना होता है। इससे कोड में एकता लाई जा सकती है और कोड को बेहतर रूप से संगठित किया जा सकता है।
4. Interface के उपयोग से क्या लाभ हो सकता है?
Ans. Interface के उपयोग से कई लाभ हो सकते हैं: - कोड की फिटचर एकता लाई जा सकती है, क्योंकि एक Interface को एक से अधिक क्लास इम्पलीमेंट कर सकती हैं। - कोड में पेरेंट-चाइल्ड रिलेशनशिप को संगठित करने में मदद मिलती है। - कोड की रियूजेबिलिटी बढ़ाती है, क्योंकि इंहेरिटेंस की जगह Interface उपयोग की जा सकती है।
5. Interface को कैसे बनाया जाता है और किसी क्लास ने उसे कैसे इम्पलीमेंट किया जाता है?
Ans. Interface को बनाने के लिए 'interface' की कीवर्ड का उपयोग किया जाता है। इंहेरिटेंस की जगह, इंटरफेस को इम्पलीमेंट करने के लिए किसी क्लास को 'implements' की कीवर्ड का उपयोग करना होता है। उस क्लास में सभी विधियों का ओवरराइड करना होता है जो इंटरफेस में डिफ़िनिशन लिखी गई हैं।
Related Searches

Important questions

,

Exam

,

practice quizzes

,

mock tests for examination

,

MCQs

,

Lecture 25 Interface in Java Hindi Video Lecture | Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

,

Summary

,

Semester Notes

,

past year papers

,

Previous Year Questions with Solutions

,

Objective type Questions

,

Lecture 25 Interface in Java Hindi Video Lecture | Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

,

Viva Questions

,

Lecture 25 Interface in Java Hindi Video Lecture | Java Programming Fundamentals: For Beginners (in Hindi) - Back-End Programming

,

shortcuts and tricks

,

Free

,

Extra Questions

,

pdf

,

video lectures

,

study material

,

Sample Paper

,

ppt

;