Questions Concepts
GitHub icon


Inheritance - language feature

< >
class B {} class A extends B {}
Example from Python, Cython:
class SumComputer(object): def __init__(self, a, b): self.a = a self.b = b def transform(self, x): raise NotImplementedError def inputs(self): return range(self.a, self.b) def compute(self): return sum(self.transform(value) for value in self.inputs()) class SquareSumComputer(SumComputer): def transform(self, x): return x * x class CubeSumComputer(SumComputer): def transform(self, x): return x * x * x
Example from Speedie:
class Person (Animal)

Languages with Inheritance include Java, JavaScript, Python, PHP, Scala, TypeScript, Dart, CoffeeScript, Groovy, Pug, SystemVerilog, Cython, C3, Speedie, Twig, Pizza, Apex, spider, JS++, SpiderBasic, Oracle Java, Deesel, Static Typescript

Languages without Inheritance include progsbase

This question asks: Does this language have class inheritance?

Read more about Inheritance on the web: 1.

HTML of this page generated by Features.ts

View source

- Build the next great programming language Search Add Language Features Creators Resources About Blog Acknowledgements Queries Stats Sponsor Traffic Traffic Today Day 305 Logout