types.Class.getbase
Method on every
classReturns the class this class inherits from.
Return value
The base class given in class Derived(Base) { ... }, or null for a class with no base.
Notes
Marked pure: the result depends only on which class object getbase is called on, since a class's base is fixed at declaration and never changes afterward.
Example
class Animal { legs = 4 }
class Dog(Animal) {}
println("Dog.getbase() == Animal =", Dog.getbase() == Animal)
println("Animal.getbase() =", Animal.getbase())Output:
Dog.getbase() == Animal = true
Animal.getbase() = nullSee also
getclass | Returns the class this instance was constructed from. |
classof | Returns the class that obj belongs to. |
| class | class index |