© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
56 replies
Costin

✅ 3 objects inheritance thing + force call base.DoThing();

So I want to make Class3 inheriting Class2 inheriting abstract Class1, to have Class1's function.
Very confusing, but here's what I'm trying to do in code:
public class Class3 : Class2 {
     public ... void DoThing() { // any way????
          //I would also want to forcely call Class2's DoThing without the programmer removing the base.DoThing();
          //code
     }  
}
public class Class3 : Class2 {
     public ... void DoThing() { // any way????
          //I would also want to forcely call Class2's DoThing without the programmer removing the base.DoThing();
          //code
     }  
}

public class Class2 : Class1 {
   public override void DoThing() {
       //code
   }
}
public class Class2 : Class1 {
   public override void DoThing() {
       //code
   }
}

public abstract class Class1 {
   public abstract void DoThing();
}
public abstract class Class1 {
   public abstract void DoThing();
}

Bonus, I would also want to forcely call Class2's DoThing without the programmer removing the base.DoThing();
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Call base method in multiple inheritance
C#CC# / help
3y ago
❔ C# Inheritance Topic Question Mostly about base constructors
C#CC# / help
3y ago
Next page