• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

implementing multiple interfaces?

Engaged ,
Feb 03, 2012 Feb 03, 2012

Copy link to clipboard

Copied

Hi there guys,

Can I implement more than one interface to the same class?

One option is to make interface A extend interface B and than have my class inplementing interface A. Is there any other way that I can implement two or more interfaces directly to the same class?

Thank you!

TOPICS
ActionScript

Views

818

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Feb 03, 2012 Feb 03, 2012

You can implement multiple interfaces just by separating them with a comma:

public class ClassName implements interface1, interface2

Votes

Translate

Translate
Guest
Feb 03, 2012 Feb 03, 2012

Copy link to clipboard

Copied

You can implement multiple interfaces just by separating them with a comma:

public class ClassName implements interface1, interface2

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 03, 2012 Feb 03, 2012

Copy link to clipboard

Copied

I tried that and gave me an error, that's why I ended up here.

Probably I spelled something wrong.

Thanks mate!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 03, 2012 Feb 03, 2012

Copy link to clipboard

Copied

LATEST

Maybe - because you can definitely do it. One thing to be aware of though is when you're typing your object - if you use the base class that implements the interfaces you can call methods from either interface. But if you type your object to one of the interfaces you can only call methods defined by that interface...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines