146k views
3 votes
Which of the following cannot be added to a sub class? Select one:

a. New public class level variables
b. New private class level variables
c. New public methods
d. New private methods
e. If you think all of the above can be added to a sub class, select this option

1 Answer

5 votes

Final answer:

New private class level variables cannot be added to a subclass.

Step-by-step explanation:

When subclassing in object-oriented programming, new public class level variables, new public methods, and new private methods can be added to the subclass. However, new private class level variables cannot be added to a subclass as they are not inherited from the superclass. Private variables are only accessible within the class they are declared in and cannot be accessed or modified by subclasses

User Umbreen
by
7.2k points