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 7981681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:26:54+00:00 2026-06-04T10:26:54+00:00

i am learning about the difference between abstract classes and interfaces, but theoretical explanations

  • 0

i am learning about the difference between abstract classes and interfaces,
but theoretical explanations are hard to understand when you don’t have practical example.
i have read that:
By updating the base class, all inheriting classes are automatically updated with the change. Interfaces, on the other hand, cannot be changed once created. If a new version of an interface is required, you must create a whole new interface.
if can someone please supply me an practical example for this lines i will be very thankful,
Wishing you a pleasant week.

  • 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-06-04T10:26:56+00:00Added an answer on June 4, 2026 at 10:26 am

    Consider this example. We have a drivable interface, automobile abstract, and a Pinto class that uses both.

    interface Drivable 
    {
      public function go();
    }
    
    abstract class Automobile 
    {
      public $type;
    
      public function getType() {
        return $this->type;
      }
    }
    
    class Pinto
        extends Automobile
        implements Drivable 
    {
      public function go() {
        // code to make it go
      }
    }
    

    We can easily add methods to all automobiles by defining them in Automobile. Any new method added there will be available to all extending classes.

    However, if we add a method to the Drivable interface, we must seek out and implement said method in every class that implements it to add the new method or else it won’t compile.

    For example, say we add a stop() method to our interface. Pinto will immediately raise errors because it doesn’t have a stop method.

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

Sidebar

Related Questions

I'm learning about packages. I have two classes that are in different packages and
We're learning about the difference between regular languages and regex, and the teacher explained
I was reading (and am still learning) about the difference between the EXISTS and
I'm still learning about Objective-C memory management. I'm trying to implement several simple classes
Recently I have been learning about WMI and WQL. I found out the list
I'm learning about C++ in a class right now and I don't quite grok
I'm learning about ASP.NET, mainly by following through a book, but also making an
I'm looking at namespaces and I don't really see a difference between these and
So, I am learning about pointers via http://cplusplus.com/doc/tutorial/pointers/ and I do not understand anything
Learning a bit about the differences between XHTML and HTML, I looked at the

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.