INTERFACES

Hello, can someone explain me the diference betwen Interfaces and heritage?
3 Replies
JavaBot
JavaBot3w ago
This post has been reserved for your question.
Hey @Carlos! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
OMIDD
OMIDD3w ago
inheritance → Like Family Traits You inherit traits from your parents—maybe your dad’s height or your mom’s eye color. Similarly, a class inherits properties and behaviors from a parent class. You don’t have to redefine them; they’re just passed down. Interfaces → Like a Job Requirement A company doesn’t care about your last name; they need you to have certain skills. To be a pilot, you must know how to fly a plane. To be a chef, you must know how to cook. An interface is just a contract that says, “If you want to be in this category, you must have these methods.” So, inheritance is like getting traits from your parents, while an interface is like meeting job requirements! i hope that helps
JavaBot
JavaBot3w ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?