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

  • Home
  • SEARCH
  • 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 643705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:18:43+00:00 2026-05-13T21:18:43+00:00

It seems to me that both interface and abstract function are quite similar, it’s

  • 0

It seems to me that both interface and abstract function are quite similar,

it’s like an order that some method must be implemented,

so what’s the difference?

  • 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-13T21:18:43+00:00Added an answer on May 13, 2026 at 9:18 pm

    Have a look at this.

    Quoting: (Very Good Explantion by e-satis)

    Interface

    An interface is a contract: the guy writing the interface say “hey, I accept things looking that way”, and the guy using the interface say “OK, the class I write looks that way”.

    And interface is an empty shell, there are only the signatures (name / params / return type) of the methods. The methods do not contain anything. The interface can’t do anything. It’s just a pattern.

    E.G (pseudo code):

    // I say all motor vehicles should look like that :
    interface MotorVehicle
    {
        void run();
    
        int getFuel();
    }
    
    // my team mate complies and write vehicle looking that way
    class Car implements MotoVehicle
    {
    
        int fuel;
    
        void run()
        {
            print("Wrroooooooom");
        }
    
    
        int getFuel()
        {
            return this.fuel;
        }
    }
    

    Implementing an interface consume very little CPU, because it’s not a class, just a bunch of names, and therefor there is no expensive lookup to do. It’s great when it matters such as in embedded devices.

    Abstract classes

    Abstract classes, unlike interfaces, are classes. There are more expensive to use because there is a lookup to do when you inherit from them.

    Abstract classes look a lot like interfaces, but they have something more : you can define a behavior for them. It’s more about a guy saying “these classes should look like that, and they got that in common, so fill in the blanks !”.

    e.g:

    // I say all motor vehicles should look like that :
    abstract class MotorVehicle
    {
    
        int fuel;
    
        // they ALL have fuel, so why let others implement that ?
        // let's make it for everybody
        int getFuel()
        {
             return this.fuel;
        }
    
        // that can be very different, force them to provide their
        // implementation
        abstract void run();
    
    
    }
    
    // my team mate complies and write vehicle looking that way
    class Car extends MotorVehicule
    {
        void run()
        {
            print("Wrroooooooom");
        }
    }
    

    By: https://stackoverflow.com/users/9951/e-satis

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So basically i have a domain object and a generic repository that can do
Purpose of the app: A simple app that draws a circle for every touch
I am attempting to communicate with a rather specific USB device and developing both
I know that I should encodeURI any url passed to anything else, because I
I'm looking for some thoughts on which design pattern(s) to use for my problem,
What are the differences and the implications of the differences between the boilerplate push
I'm pretty much a novice as far as WCF goes and I'm trying to
This is a rather elementary C# question; my apologies, but I haven't been able
Consider the automation-compatible COM library in C#, given below. It follows a common COM
I've been searching the net for answers but I can't seem to find a

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.