पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 20 के उत्तर और हल FliQi Question Bank app में।
भाषा
प्रश्न 1उत्तर + हल
सिस्टम का गतिशील व्यवहार दिखाने के लिए कौन-सा UML आरेख इस्तेमाल होता है?
Which UML diagram is used to represent the dynamic behaviour of a system?
Aऑब्जेक्ट आरेखObject diagram
Bक्लास आरेखClass diagram
Cसीक्वेंस आरेखSequence diagram
Dकंपोनेंट आरेखComponent diagram
सही उत्तर / Answer: (C)
हल / Solution
सीक्वेंस आरेख दिखाता है कि कोई काम पूरा होने में वस्तुएँ आपस में कौन-से संदेश, किस क्रम में भेजती हैं। समय की यह रेखा ही उसे गतिशील व्यवहार का आरेख बनाती है। बाक़ी तीनों ढाँचा दिखाने वाले आरेख हैं — क्लास आरेख वर्ग और उनके संबंध, ऑब्जेक्ट आरेख किसी एक क्षण की वस्तुएँ, और कंपोनेंट आरेख सिस्टम के भाग तथा उनके बीच के इंटरफ़ेस।
A sequence diagram shows which messages the objects send to one another, and in what order, while a piece of work is carried out. This time line is exactly what makes it a diagram of dynamic behaviour. The other three are structural diagrams: a class diagram shows classes and their relationships, an object diagram shows the objects existing at one moment, and a component diagram shows the parts of the system and the interfaces between them.
प्रश्न 2उत्तर + हल
UML में क्लास आरेख क्या दर्शाता है?
What does a class diagram in UML represent?
Aसिस्टम का व्यवहारThe behaviour of a system
Bवस्तुओं के बीच का आदान-प्रदानThe interactions between objects
Cसिस्टम की स्थिर संरचनाThe static structure of a system
Dसिस्टम के भीतर नियंत्रण का प्रवाहThe flow of control within a system
सही उत्तर / Answer: (C)
हल / Solution
क्लास आरेख में वर्ग, उनके गुण, विधियाँ और आपसी संबंध खींचे जाते हैं। यह चित्र बताता है कि सिस्टम किन हिस्सों से बना है, न कि वह चलते समय क्या करता है, इसलिए इसे स्थिर संरचना का आरेख कहा जाता है। वस्तुओं के बीच संदेशों का आदान-प्रदान सीक्वेंस आरेख दिखाता है और नियंत्रण का प्रवाह एक्टिविटी आरेख। व्यवहार वाली सारी बातें इन्हीं गतिशील आरेखों में आती हैं।
A class diagram draws the classes, their attributes, their methods and the relationships between them. It tells us what parts the system is built from, not what it does while running, which is why it is called the static structure of the system. Messages exchanged between objects are shown by a sequence diagram, and the flow of control is shown by an activity diagram, so every behavioural aspect belongs to those dynamic diagrams.
प्रश्न 3उत्तर + हल
सिस्टम की स्थिर संरचना दिखाने के लिए कौन-सा UML आरेख इस्तेमाल होता है?
Which UML diagram is used to represent the static structure of a system?
Aयूज़ केस आरेखUse case diagram
Bक्लास आरेखClass diagram
Cसीक्वेंस आरेखSequence diagram
Dएक्टिविटी आरेखActivity diagram
सही उत्तर / Answer: (B)
हल / Solution
क्लास आरेख बताता है कि सिस्टम में कौन-से वर्ग हैं, हर वर्ग के पास क्या गुण और विधियाँ हैं, और वर्ग आपस में किस तरह जुड़े हैं। यह ढाँचा समय के साथ बदलता नहीं, इसलिए इसे स्थिर संरचना का आरेख कहते हैं। यूज़ केस आरेख बाहरी उपयोगकर्ता और कार्य दिखाता है, सीक्वेंस आरेख संदेशों का क्रम और एक्टिविटी आरेख कार्य का प्रवाह — ये तीनों व्यवहार से जुड़े हैं।
A class diagram shows which classes exist in the system, what attributes and methods each class has, and how the classes are linked to one another. This picture does not change as the program runs, so it is called the static structure of the system. A use case diagram shows external actors and functions, a sequence diagram shows the order of messages, and an activity diagram shows the flow of work, so all three describe behaviour.
प्रश्न 4उत्तर + हल
वस्तु-उन्मुख डिज़ाइन में यूनिफ़ाइड मॉडलिंग लैंग्वेज (UML) का उद्देश्य क्या है?
What is the purpose of the Unified Modeling Language (UML) in Object-Oriented Design?
Aसिस्टम की आवश्यकताएँ लिखनाTo specify system requirements
Bआरेखों की मदद से सिस्टम का दृश्य प्रतिरूप बनानाTo model the system visually using diagrams
Cसीधे कोड लिखनाTo write code directly
Dउपयोगकर्ता स्वीकृति परीक्षण करानाTo conduct user acceptance testing
सही उत्तर / Answer: (B)
हल / Solution
UML कोई प्रोग्रामिंग भाषा नहीं, एक मानक चित्र-भाषा है। इसमें तय चिह्नों और आरेखों से यह दिखाया जाता है कि सिस्टम में कौन-से वर्ग हैं, वे कैसे जुड़े हैं और काम किस क्रम में चलता है। इससे डिज़ाइन सब लोगों को एक ही तरह समझ में आता है। आवश्यकताएँ लिखना विश्लेषण का काम है, कोड किसी प्रोग्रामिंग भाषा में लिखा जाता है, और स्वीकृति परीक्षण अंत का चरण है।
UML is not a programming language but a standard visual notation. Using agreed symbols and diagrams it shows which classes a system contains, how they are connected, and in what order the work flows. This lets every member of the team read the same design in the same way. Writing requirements belongs to analysis, code is written in an actual programming language, and acceptance testing is a much later stage.
प्रश्न 5उत्तर + हल
वस्तु-उन्मुख डिज़ाइन में समुच्चयन (aggregation) और संघटन (composition) में क्या अंतर है?
What is the difference between aggregation and composition in Object-Oriented Design?
Aसमुच्चयन में भाग वस्तु पूरी वस्तु के साथ ही नष्ट हो जाती हैIn aggregation the part object is destroyed along with the whole
Bसंघटन का संबंध समुच्चयन से कमज़ोर होता हैComposition implies a weaker relationship than aggregation
Cसमुच्चयन में स्वामित्व साझा रहता है, जबकि संघटन में स्वामित्व पूरी तरह एक का होता हैAggregation involves sharing ownership, while composition involves exclusive ownership
Dसमुच्चयन और संघटन एक ही बात के दो नाम हैंAggregation and composition are synonymous terms
सही उत्तर / Answer: (C)
हल / Solution
दोनों has-a संबंध हैं, पर पकड़ की मज़बूती अलग है। समुच्चयन में भाग कई पूरों के साथ जुड़ सकता है और पूरे के मिट जाने पर भी बना रहता है, जैसे विभाग और अध्यापक। संघटन में भाग पर एक ही वस्तु का पूरा अधिकार होता है और पूरा मिटते ही भाग भी मिट जाता है, जैसे घर और कमरा। इसीलिए पहला और दूसरा कथन उलटी बात कहते हैं, और चौथा दोनों को एक मान बैठता है।
Both are has-a relationships, but the strength of the hold differs. In aggregation the part may be shared by several wholes and survives after the whole is gone, as a teacher outlives a department. In composition one object owns the part completely, and when the whole is destroyed the part is destroyed with it, as rooms go with a house. The first two statements therefore reverse the facts, and the fourth wrongly treats the two terms as identical.
प्रश्न 6उत्तर + हल
वस्तु-उन्मुख डिज़ाइन में has-a संबंध का उद्देश्य क्या है?
What is the purpose of the has-a relationship in Object-Oriented Design?
Aवर्गों के बीच वंशानुक्रम दिखानाTo model inheritance between classes
Bवस्तुओं का व्यवहार परिभाषित करनाTo define the behaviour of objects
Cवस्तुओं के बीच स्वामित्व या समावेश दिखानाTo represent ownership or containment between objects
Dवस्तु के भीतर डेटा को संवेष्टित करनाTo encapsulate data within objects
सही उत्तर / Answer: (C)
हल / Solution
has-a का अर्थ है कि एक वस्तु के भीतर दूसरी वस्तु रहती है — जैसे कार के पास इंजन होता है। यह समावेश या स्वामित्व दिखाता है और समुच्चयन तथा संघटन इसी के रूप हैं। वंशानुक्रम वाला संबंध is-a कहलाता है, जैसे कार एक वाहन है, इसलिए पहला विकल्प दूसरे संबंध की बात कर रहा है। व्यवहार तय करना विधियों का काम है और डेटा छिपाना संवेष्टन का।
A has-a relationship means that one object contains another, as a car has an engine. It expresses containment or ownership, and aggregation and composition are its two forms. The inheritance relationship is written as is-a, for example a car is a vehicle, so the first option describes a different link altogether. Defining behaviour is the job of methods, and hiding data inside an object is encapsulation, so those options do not fit.
प्रश्न 7उत्तर + हल
इनमें से कौन-सा वस्तु-उन्मुख डिज़ाइन का सिद्धांत नहीं है?
Which of the following is not a principle of Object-Oriented Design?
Aअमूर्तन (abstraction)Abstraction
Bवंशानुक्रम (inheritance)Inheritance
Cमॉड्यूलरता (modularity)Modularity
Dप्रक्रियात्मक प्रोग्रामिंगProcedural programming
सही उत्तर / Answer: (D)
हल / Solution
अमूर्तन, वंशानुक्रम और मॉड्यूलरता तीनों वस्तु-उन्मुख डिज़ाइन के सिद्धांतों में गिने जाते हैं। प्रक्रियात्मक प्रोग्रामिंग इससे अलग शैली है, जिसमें कार्यक्रम फलनों की शृंखला होता है और डेटा उनसे बाहर पड़ा रहता है। वहाँ न वर्ग होते हैं, न वस्तुएँ, इसलिए वह सिद्धांत नहीं बल्कि एक प्रतिद्वंद्वी दृष्टिकोण है। यही कारण है कि यही विकल्प बाक़ी तीनों से अलग पड़ जाता है।
Abstraction, inheritance and modularity are all counted among the principles of object oriented design. Procedural programming is a different style altogether, in which a program is a chain of functions and the data lies outside them. It has neither classes nor objects, so it is not a principle of this approach but a rival approach to it. That is why procedural programming is the option which does not fit with the other three.
प्रश्न 8उत्तर + हल
वस्तु-उन्मुख डिज़ाइन में वर्ग (class) क्या होता है?
What is a class in Object-Oriented Design?
Aकिसी वस्तु का एक उदाहरणAn instance of an object
Bवस्तुएँ बनाने का साँचाA blueprint for creating objects
Cआधारभूत मान रखने वाली डेटा संरचनाA data structure that holds primitive values
Dविधियों का समूहA collection of methods
सही उत्तर / Answer: (B)
हल / Solution
वर्ग एक साँचा है, जिसमें लिखा रहता है कि उसकी वस्तुओं के पास कौन-सा डेटा होगा और कौन-सी विधियाँ। उसी साँचे से जितनी चाहें वस्तुएँ बनाई जा सकती हैं, और हर वस्तु अपने मान अलग रखती है। उदाहरण यानी instance तो वस्तु होती है, वर्ग नहीं, इसलिए पहला विकल्प उलटा है। तीसरा विकल्प साधारण डेटा संरचना की बात करता है और चौथा सिर्फ़ विधियाँ गिनाता है, जबकि वर्ग में डेटा भी होता है।
A class is a blueprint that states which data and which methods its objects will have. Any number of objects can be created from that single template, and each object keeps its own copy of the values. An instance is the object, not the class, so the first option reverses the relationship. The third option describes a plain data structure, and the fourth mentions only methods, while a class holds data as well.
प्रश्न 9उत्तर + हल
वस्तु-उन्मुख डिज़ाइन में बहुरूपता (polymorphism) को सबसे अच्छी तरह कौन बताता है?
Which of the following best describes polymorphism in Object-Oriented Design?
Aएक ही विधि के कई क्रियान्वयन हो सकने की क्षमताThe ability of a method to have multiple implementations
Bकिसी वस्तु के एक साथ कई वर्गों का होने की क्षमताThe ability of an object to belong to multiple classes
Cवस्तु के अपनी भीतरी अवस्था छिपाने की क्षमताThe ability of an object to hide its internal state
Dवर्ग के कई निर्माता (constructor) रखने की क्षमताThe ability of a class to have multiple constructors
सही उत्तर / Answer: (A)
हल / Solution
बहुरूपता का अर्थ है एक नाम, कई रूप। एक ही विधि का नाम अलग-अलग वर्गों में अलग तरह से लिखा जा सकता है, और चलने के समय वस्तु के असली प्रकार के अनुसार सही रूप अपने आप चुना जाता है। इसी से कोड सामान्य रहता है। भीतरी अवस्था छिपाना संवेष्टन है, कई निर्माता रखना overloading का एक उदाहरण भर है, और एक वस्तु एक ही वर्ग की होती है।
Polymorphism means one name with many forms. The same method name can be implemented differently in different classes, and at run time the correct version is chosen automatically according to the actual type of the object. This is what keeps calling code general. Hiding the internal state is encapsulation, having several constructors is just one example of overloading, and an object always belongs to a single class, so those options are wrong.
प्रश्न 10उत्तर + हल
वस्तु-उन्मुख डिज़ाइन में वंशानुक्रम (inheritance) रखने का उद्देश्य क्या है?
What is the purpose of inheritance in Object-Oriented Design?
Aमौजूदा वर्गों से नए वर्ग बनानाTo create new classes from existing classes
Bवस्तु के भीतर डेटा को संवेष्टित करनाTo encapsulate data within objects
Cकोड का पुन: उपयोग और मॉड्यूलरता बढ़ानाTo enforce code reuse and promote modularity
Dवस्तुओं का व्यवहार परिभाषित करनाTo define the behaviour of objects
सही उत्तर / Answer: (C)
हल / Solution
यहाँ ध्यान दीजिए कि प्रश्न उद्देश्य पूछ रहा है, तरीक़ा नहीं। मौजूदा वर्ग से नया वर्ग बनाना वंशानुक्रम का तरीक़ा है, पर वह किया किसलिए जाता है — इसलिए कि साझा गुण और विधियाँ एक ही जगह लिखी जाएँ और हर उपवर्ग उन्हें दोबारा लिखे बिना पा जाए। यानी कोड का पुन: उपयोग और मॉड्यूलरता ही असली मक़सद है। संवेष्टन और व्यवहार तय करना अलग अवधारणाएँ हैं।
Notice that the question asks for the purpose, not the mechanism. Creating a new class from an existing one is how inheritance works, but the reason for doing it is that shared attributes and methods can be written once in the parent and obtained by every subclass without repetition. So code reuse and modularity are the real aim. Encapsulation and defining the behaviour of objects are separate concepts and do not answer this question.
आगे के 20 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति