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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:42:34+00:00 2026-06-04T13:42:34+00:00

I am studying the differences between Abstract and Interface and I read some sentence

  • 0

I am studying the differences between Abstract and Interface and I read some sentence
saying

A child class can only extend a single abstract (or any other) class,
whereas an interface can extend or a class can implement multiple
other interfaces.

I understand when he says, “A child class can only extend a single abstract (or any other) class,” he means:

class first
{
    public function Search()
    {
        return 'Hellow';
    }
}

abstract class first2 extends first
{

}

class second extends first2
{   

}

$ob = new second();
echo $ob->Search();

However, I didn’t understand the rest of his sentence, where he says, “whereas an interface can extend or a class can implement multiple other interfaces.”

Could someone please explain his last sentence and add a code example?
Thank you all and have a nice day.

  • 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-04T13:42:35+00:00Added an answer on June 4, 2026 at 1:42 pm

    You can implement more than one interface

    interface C {
      public function method1();
    }
    
    interface D {
      public function method2();
    }
    
    class A implements C,D {
    
       //implement from interface C
       public function method1() {
    
       }
       //implement from interface D
       public function method2() {
    
       }
    }
    

    Here you will need implement methods from interface C and D. You can also extend interfaces within interfaces, like normal classes.

    interface D extends C{}
    

    It’s useful when well you need some common methods. so you write “schema” into interface what methods you are expecting from base class to be implemented.

    While abstract is single extended class, you canot create instance for it, only extend. It’s useful when you want have some base class with common functionality or abstract methods what should be implemented later.

    More you can always read at php.net – interfaces

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

Sidebar

Related Questions

I studying NSCharacterset class. NSString and NSCharacterset look like similar class. Who can explain
while studying some security things, there was a question that one can guess the
After studying TCP/UDP difference all week, I just can't decide which to use. I
In studying actionscript 3's graphics class, I've come across the undocumented drawRoundRectComplex() method. It's
Possible Duplicate: What are the differences between pointer variable and reference variable in C++?
While studying Java tutorials, Reflection and Late Binding have confused me. In some tutorials,
While studying the Collection API, we find that some methods ( add , remove
I'm studying Prism and need to create a small demo app. I have some
I was studying the difference between lists and tuples (in Python). An obvious one
Studying JSR-299, I read section 5.1 of the Weld reference which explains how scopes

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.