Question
In OOP, which concept allows a subclass to provide a
specific implementation of a method already defined in its parent class?Solution
Method overriding allows a subclass to redefine a method of its parent class to provide more specific behavior. 1. Dynamic Binding: Overriding enables dynamic (runtime) polymorphism, allowing a subclass method to be invoked via a parent class reference. 2. Specialization: It customizes inherited behavior, making objects more precise in functionality. For example, a generic draw() method in a Shape class can be overridden by a Circle subclass to draw circles. 3. Liskov Substitution Principle: Overriding ensures subclass objects can seamlessly replace parent class objects without affecting system behavior. Option C exemplifies OOP’s adaptability and extendability by redefining methods at runtime. Why Other Options Are Incorrect: • A) Encapsulation: Manages data access, unrelated to redefining methods. • B) Method Overloading: Involves multiple methods with the same name but different parameters, unrelated to inheritance. • D) Abstraction: Focuses on defining essential features, unrelated to runtime behavior customization. • E) Composition: Relates to object containment, not method redefinition.
Why is sampling often preferred over using the entire population for data analysis?
What is the primary function of a Decision Support System (DSS) in Management Information Systems?
Which of the following is a key difference between TCP and UDP in the transport layer of the TCP/IP model?
Which of the following best describes the main difference between random and non-random sampling methods?
Which of the following Software Development Life Cycle (SDLC) models is best suited for projects where the requirements are unclear or evolving rapidly?
Which of the following is the primary benefit of using APIs over web scraping for data collection from a website?
In Python, missing values in DataFrame are represented as:
Which of the following best describes the difference between simple moving averages and exponential smoothing in forecasting?
In time series forecasting, which of the following is true regarding the impact of autocorrelation on the model?
In developing a fraud detection model for online transactions, a data analyst should use a technique capable of identifying anomalous patterns. Which of...