Which of the following statements is completely true? I. In an object-oriented…

2023

Which of the following statements is completely true? I. In an object-oriented programming language, all the function calls are resolved at compile-time. II. In a procedural programming language, all the function calls are resolved at compile-time.

  1. A.

    Only II

  2. B.

    Only I

  3. C.

    Both I and II

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 162 students.

Show answer & explanation

Correct answer: A

Step 1: In object-oriented programming (OOP), function calls can be resolved at runtime due to features like polymorphism and inheritance. This means the actual function called depends on the object type, not just the function name. Therefore, statement I is false because not all function calls are resolved at compile-time.

Step 2: In procedural programming, function calls are resolved at compile-time because functions are statically linked. The compiler determines which function to call based on the function name and parameters. Therefore, statement II is true.

Step 3: Since only statement II is true, the correct option is A (Only II).

हिन्दी उत्तर:

चरण 1: ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग (OOP) में, फ़ंक्शन कॉल रनटाइम पर भी हो सकते हैं क्योंकि बहुरूपता और विरासत जैसी विशेषताओं के कारण। इसका अर्थ है कि वास्तविक फ़ंक्शन वस्तु के प्रकार पर निर्भर करता है, केवल फ़ंक्शन नाम पर नहीं। इसलिए, कथन I गलत है क्योंकि सभी फ़ंक्शन कॉल कंपाइल-टाइम पर नहीं होते हैं।

चरण 2: प्रोसीजरल प्रोग्रामिंग में, फ़ंक्शन कॉल कंपाइल-टाइम पर ही होते हैं क्योंकि फ़ंक्शन स्थिर रूप से जुड़े होते हैं। कंपाइलर फ़ंक्शन नाम और पैरामीटर के आधार पर यह निर्धारित करता है कि कौन सा फ़ंक्शन कॉल करना है। इसलिए, कथन II सही है।

चरण 3: चूँकि केवल कथन II सही है, सही विकल्प A (केवल II) है।

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs