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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:54:11+00:00 2026-05-25T11:54:11+00:00

can you give me a simple example of inheritance and polymorphism, so it could

  • 0

can you give me a simple example of inheritance and polymorphism, so it could be fully clear and understandable?

using C# would make it more clear, as I already learned it.

P.S: the tutors, books we’ve got are in native language, (arabic)

sorry if that question seemed so easy, even silly on you guys, but these concepts are considered hard; if you don’t fully understand them, then you fail.

  • 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-05-25T11:54:12+00:00Added an answer on May 25, 2026 at 11:54 am

    Let’s use my favorite verb and we find:

    http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29

    http://msdn.microsoft.com/en-us/library/ms173152%28v=vs.80%29.aspx

    Polymorphism and Inheritance are pivotal, need-to-be-ingrained and fundamental concepts to C# and object oriented programming. saying you know C# and not this is like knowing how to speak English and have no concept of what the alphabet is. Sorry to be blunt, but it is true.

    From the Wiki link above (this is not mine), here is an example of Polymorphism (converted to C#…)

    public class Animal
    {
        public virtual String talk() { return "Hi"; }
        public string sing() { return "lalala"; }
    }
    
    public class Cat : Animal
    {
        public override String talk() { return "Meow!"; }
    }
    
    public class Dog : Animal
    {
        public override String  talk() { return "Woof!"; }
        public new string sing() { return "woofa woofa woooof"; }
    }
    
    public class CSharpExampleTestBecauseYouAskedForIt
    {
        public CSharpExampleTestBecauseYouAskedForIt()
        {
            write(new Cat());
            write(new Dog());
        }
    
        public void write(Animal a) {
            System.Diagnostics.Debug.WriteLine(a.talk());
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone give a simple example of a DB transaction using an Intentional Shared
can someone give me simple example in c, of using pipe() system call to
Can someone give me a very simple example of how one would, say, write
Can someone give me a simple example involving threads in this manner, please. Problem
Guys, can anyone give a simple practical example of LockSupport & AbstractQueuedSynchronizer use? Example
Can someone give me a simple example of a AnnotatedTimeLine visualization? All the examples
Can some one give me a simple example of Raphael eve() ? I don't
Can someone give a simple example of updating a textfield every second or so?
Can you give me any simple example? For example I took an error when
Can someone give me a simple example on how to user user-settings instead of

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.