RE: Anyone know anything about polymorphism? 05-27-2015, 02:14 AM
#3
(05-27-2015, 01:59 AM)6e6b Wrote: maybe this site would help? http://www.tutorialspoint.com/java/java_...rphism.htm
public interface Vegetarian{}
public class Animal{}
public class Deer extends Animal implements Vegetarian{}
Now, the Deer class is considered to be polymorphic since this has multiple inheritance. Following are true for the above example:
A Deer IS-A Animal
A Deer IS-A Vegetarian
A Deer IS-A Deer
A Deer IS-A Object
Better in Code, Definitions are.
Thanks, dude. The code you supplied is pretty informative, even with my limited Java knowledge. (However, I figured it out after messing with classes and methods in Ruby)
Just one thing, use code tags ("code" and "/code", replacing the " with square brackets) when writing out code, as it keeps indents intact.
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.
don't have much in the first place, who feel the new currents and ride them the farthest.















![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)