which statement is true?1)public methods of a superclass cannot be overridden in subclasses.2)Protected methods of a superclass cannot be overridden in subclasses.3)methods with default access in a superclass cannot be overridden in subclasses.4) private methods of a superclass cannot be overridden in subclasses.
Answers
Answer:
1
Explanation:
please subscribe my channel Arnav educational
From the above-given statements, statement 1 is true which is
Public methods of a superclass cannot be overridden in subclasses.
The subclasses are those classes derived from other classes' parameters.
We can say that a subclass is a primary division of a course. A superclass is a class which can not be overridden in the case of any public method because such methods are non-changeable in nature. In java language, these classes are defined differently as inheriting fields and methods of other classes for their function. So we can say that a subclass is an extended version of a superclass in the case of public methods.
The above explanation proves that there is no way of overriding a public method in subclasses of a superclass.
Learn more about superclass
https://brainly.in/question/608857
https://brainly.in/question/13034071
#SPJ2