class B {}
class A extends B {}
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
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