Example

Classes using inheritance and parent

Developer extends Person, then override Description and still call the parent's version first.

Save this as a .alana file, then alana filename.alana. And start coding cute.

define class Person;

public:
define str name is new;

define constructor(str name);
    redefine self.name is name;
end;

define func Description() returning str;
    return self.name;
end;

end;


define class Developer extends Person;

public:
define constructor(str name);
    call parent(name);
end;

define override func Description() returning str;
    return call parent.Description() + " is a developer";
end;

end;


define Developer developer is newobj Developer("Jacob");

showln call developer.Description();