© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
147 replies
JammyG

Calling methods from a base class

Hi, I am completing a beginners c# course and i'm stuck on this question - this section of the course is about polymorphism and inhertiance.

The code was already written, I have added an 'ALevelComputerStudent' class, and now I must add functionality to pick which type of student is created. I'm not sure how to do this.

I've tried using an interface, but then when I use an interface for 'ALevelComputerStudent' + 'GCSEStudent' classes, i can no longer call methods from the base class. I know there are other ways of doing it , but for the purpose of the question I have one base class which the rest add onto

I just cant get my head around when to use inheritance and interfaces without changing all of the existing code written around the 'AStudent' object
any help/ explanation would be appreciated 🙂
Screenshot_2024-01-31_193229.png
Program.cs6.17KB
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
Next page

Similar Threads

Calling a method from static class which also inherits from a non static class
C#CC# / help
3y ago
Base Class architecture
C#CC# / help
2y ago
Multiple classes defining same props vs inherit from base class
C#CC# / help
4y ago