You are viewing a single comment's thread. Return to all comments →
I think in a real scenario, may be better for input if the user wants to change the number however, here is my solution.
int getInt(){ return 11; } void getNumberOfTeamMembers(){ System.out.println( "Each team has " +getInt()+ " players in " + getName() ); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Method Overriding
You are viewing a single comment's thread. Return to all comments →
I think in a real scenario, may be better for input if the user wants to change the number however, here is my solution.
int getInt(){ return 11; } void getNumberOfTeamMembers(){ System.out.println( "Each team has " +getInt()+ " players in " + getName() ); }