Free help with homework

Why join Brainly?

  • ask questions about your assignment
  • get answers with explanations
  • find similar questions


The polymorphism principle is basically have a parent class and creating subclasses (children) that have almost the same functionality or are similar to the parent class but are unique in their own way.

For example you have an animal. There are many types of animals but they have some similar characteristics for example, let's say that all animals need to eat and sleep and they all have names. So the parent class, Animal, would have those eat and sleep methods.

public class Animal{
public void sleep();
public void eat();

But there are many types of animals such as birds, fish, etc. They have unique characteristics. So the children subclasses for example could look like this.

public class Bird extends Animal{
public void fly();

and a fish subclass could look like this...

public class Fish extends Animal{
public void swim();

The subclasses inherits the methods of Animal and add their own unique twist to it. :)
0 0 0
Can you please give me some more example codes that uses polymorphism
Hi! There are a lot of examples on the internet :) Just search for it :D Good luck!
The Brain
  • The Brain
  • Helper
Not sure about the answer?
Learn more with Brainly!
Having trouble with your homework?
Get free help!
  • 80% of questions are answered in under 10 minutes
  • Answers come with explanations, so that you can learn
  • Answer quality is ensured by our experts