Jason Marvin

Greenhorn
+ Follow
since Dec 27, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jason Marvin

Also, for the given example, soccer players score goals and basketball players score points?
4 years ago

Stephan van Hulst wrote:That's like asking: "What's the best approach using a saw when I need to hammer a nail?"

Why are you settling on a tool before you've analyzed the problem?

In this case, I would say that a sports team has players and a coach, both of which are persons. No inheritance needed, unless coaches and players have different properties. Even then, you can use roles instead of inheritance.

Why do you think you need inheritance?



Hi Stephan, I am learning Java online and the task is to use inheritance to modal a sports club. Are you able to expand on what you said about using roles or provide a link that i can read up on?
4 years ago
What would be the best approach using inheritance if i wish for a player to be part of a multiple sports teams which also allows for player/coach? I'm using arraylists at the moment.
4 years ago