Inheritance/Single: Difference between revisions
Content added Content deleted
m (→{{header|J}}: 5*s->1) |
m (→{{header|Java}}: 5*s->1) |
||
Line 978: | Line 978: | ||
=={{header|Java}}== |
=={{header|Java}}== |
||
<syntaxhighlight lang="java"> |
<syntaxhighlight lang="java"> |
||
public class Animal{ |
|||
//functions go here... |
//functions go here... |
||
} |
|||
⚫ | |||
public class Dog extends Animal{ |
|||
//functions go here... |
//functions go here... |
||
} |
|||
}</syntaxhighlight> |
|||
public class Cat extends Animal{ |
|||
//functions go here... |
//functions go here... |
||
} |
|||
}</syntaxhighlight> |
|||
public class Lab extends Dog{ |
|||
//functions go here... |
//functions go here... |
||
} |
|||
}</syntaxhighlight> |
|||
public class Collie extends Dog{ |
|||
//functions go here... |
//functions go here... |
||
} |
|||
}</syntaxhighlight> |
|||
⚫ | |||
=={{header|JavaScript}}== |
=={{header|JavaScript}}== |