Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6389151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:22:07+00:00 2026-05-25T03:22:07+00:00

I have a theorical/pratical question about how inheritance works in C#. Let’s say that

  • 0

I have a theorical/pratical question about how inheritance works in C#.

Let’s say that I have to model some autos, so I have a few common methods that all the autos must implement and a pilot should know. In code-words this should be an Interface:

interface Automobile {
   void speedup();
   void break();
   void steer();
   //bla bla
}

Now, all kind of car should have some common technical implementations beside the actions that a pilot can perform over them, let’s say the property fuelLevel, at this point I still don’t want to know how a car speeds up or breaks down, so I would wrote:

 abstract class Car : Automobile {
    int fuelLevel;    // for example....
    public abstract void speedup();
    public abstract void break();
    public abstract void steer();
 }

Now I want to model a Ferrari, so:

class Ferrari : Car {
    public void speedup() { ... }
    public void break() { ... }
    public void steer() { ... }
}

Now, in Java this code should work (changing some syntax), but in C# won’t because it says:

Error   1   'Ferrari' does not implement inherited abstract member 'Car.speedup()'
Error   1   'Ferrari' does not implement inherited abstract member 'Car.break()'
Error   1   'Ferrari' does not implement inherited abstract member 'Car.steer()'

Why? How should I fix this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:22:07+00:00Added an answer on May 25, 2026 at 3:22 am

    You need to mark the methods with override to cover the abstract definitions beneath:

    class Ferrari : Car 
    {
        public override void speedup() { }
        public override void break() { }
        public override void steer() { }
    }
    

    Other than that, you’re set – the Ferrari class will satisfy your interface, even though the methods are derived. Also as an aside, naming in C# is slightly different:

    • Prefix interfaces with I, IAutomobile.
    • Capital letters on methods: Speedup(), Break(), Steer().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have theoretical question about OSGi memory management. Let’s say we have some OSGi
Let's say I have a theoretical MVC framework that uses a ViewData object to
Lets say I have an application that is going to listen on a particular
I have a timer that counts down every second. It works great until the
I have a theoritical question : I have a project that has versions, for
I have got a theoretical question: I think to use files that store an
I have a very theoretical question: Is there a way to ban the use
I have been struggling to find an answer to this theoretical question, even tho
This is more of a theoretical question than an actual problem I have. If
I have read a lot about the Java class loading process lately. Often I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.