Question
When should you use inheritance over
composition?Solution
Inheritance is appropriate when there's a clear "is-a" relationship, meaning the subclass is a specific kind of the superclass and can substitute for it (Liskov Substitution Principle). Composition ("has-a" relationship) is generally preferred for code reuse when the "is-a" relationship doesn't hold.
Every three hours ___________ the experiment, participants completed _______ easy 40-minute driving scenario.
A strike by Royal Mail staff at Wythenshawe has been _______________ after a postwoman sacked for not wearing a cycle helmet was given her job back.
Each sentence has one blank. Choose the most appropriate word to make the sentence grammatically and contextually correct.
Despite repeated ass...
In each of the question given below, a statement has been given with a blank. Some words or phrases have been given in the options following the statem...
Fill in the blank/s with suitable Word/s:
She decided to _________ her career and _________ new skills to enhance her qualifications.
Each question below has two blanks, which is indicating that something has been omitted. Choose the most suitable option indicating the words that can ...
In the question given below, there is a sentence of which some parts have been jumbled. Rearrange these parts, which are labeled as P, Q, R, and S, to...
Fill in the blanks with suitable words from the options. If none of the options are appropriate, mark ‘None of these’ as the answer.
The g...
We should not _________ in others’ matters.
Each question below has one blank, which is indicating that something has been omitted. Find out which option can be used to fill up the blank in the s...