asked 176k views
3 votes
With class inheritance, a superclass takes the properties of a subclass.
a. True
b. False

1 Answer

2 votes

Final answer:

In class inheritance, a subclass takes the properties and methods of a superclass and can add or modify them.

Step-by-step explanation:

The statement 'With class inheritance, a superclass takes the properties of a subclass' is False.

In class inheritance, a subclass takes (or inherits) the properties and methods of a superclass. The subclass can then add or modify these inherited properties and methods to suit its specific needs.

For example, in a programming language like Java, you can have a class called 'Animal' as the superclass and classes like 'Dog' and 'Cat' as subclasses. The 'Dog' and 'Cat' classes can inherit properties and methods from the 'Animal' class, such as 'name' and 'sound', but can also have their own additional properties and methods, like 'fetch()' for a 'Dog'.

answered
User Jerrad
by
7.1k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.