We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Java
  3. Object Oriented Programming
  4. Java Method Overriding
  5. Discussions

Java Method Overriding

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • e_mm_u
    4 months ago+ 0 comments

    It's so simple, if you just go through the description , you can solve it.

    class Soccer extends Sports{
        @Override
        String getName(){
            return "Soccer Class";
        }
    
        // Write your overridden getNumberOfTeamMembers method here
        @Override
        void getNumberOfTeamMembers(){
            System.out.println( "Each team has 11 players in " + getName() );
        }
    }
    
    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy