aspose file tools*
The moose likes Beginning Java and the fly likes Implementing an Abstract method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Implementing an Abstract method" Watch "Implementing an Abstract method" New topic
Author

Implementing an Abstract method

rob starteren
Greenhorn

Joined: Mar 30, 2009
Posts: 2
Hi i have been given a Team class and was asked to make a subclass RugbyTeam from it.

The only abstract method in Team i have to implement is




I know how to implement it, the only thing conufusing me is the parameter variable name iProblemsSolved. For the rugby subclass should have a parameter name called goalsScored not iProblemsSolved because rugby teams score goals. Is it ok to rename this new methods parameter variable goalsScored in the RugbyTeam subclass or is this against convention.
eg.

It compiles fine as you will know. Or should the Team class abstract methods parameter variable name be renamed to comething more generic like pointsScored?

eg.


Can i have straight forward answers please, no "i think" answers. Was getting them on another forum which confused me more.
Alexis Michael
Greenhorn

Joined: Mar 29, 2009
Posts: 9
Parameter names do not matter. As long as the return type, function name, and parameter type as the same, you are on the safe side.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Is it ok to rename this new methods parameter variable goalsScored

Yes, it is ok.

Or should the Team class abstract methods parameter variable name be renamed to comething more generic like pointsScored?

It may be a matter of taste I prefer to leave the abstract name as is.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Implementing an Abstract method