Click here to Skip to main content
15,937,012 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can a subclass override a method and have different parameters in java?


What I have tried:

<pre>Can a subclass override a method and have different parameters in java?
Posted
Updated 29-Apr-21 11:06am

1 solution

No.
Overriding and Hiding Methods (The Java™ Tutorials)[^]
Quote:
The ability of a subclass to override a method allows a class to inherit from a superclass whose behavior is "close enough" and then to modify behavior as needed. The overriding method has the same name, number and type of parameters, and return type as the method that it overrides.
 
Share this answer
 
Comments
[no name] 30-Apr-21 17:22pm    
so, can I use override methods with like different params?
OriginalGriff 30-Apr-21 17:28pm    
Which letter of "No" is giving you problems?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900