Object-Oriented Programming · Question 18 · Easy

Inheritance, as in 'SavingsAccount extends Account', models which kind of relationship?

  1. has-a
  2. is-a
  3. uses-a
  4. part-of
Answer and explanation

Answer: B. is-a

Explanation: A SavingsAccount is an Account, so inheritance models an is-a relationship. has-a and part-of relationships are modelled with composition or aggregation.

Previous: Inside an instance method or constructor in Java, which keyword refers to the… · Next: Creating an object of a class, for example with new Student() in Java, is…

Practise object-oriented programming

Try a fresh set of object-oriented programming questions with an explanation after every answer, free and without signing up: Object-Oriented Programming practice. Or sit a full placement mock test.

More object-oriented programming questions

More technical & programming practice

DBMS · SQL · Operating Systems · Computer Networks · Software Engineering · Cloud & DevOps · GenAI Basics · Pseudo-code

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge