wiki/content/20201126102708-abstraction.md

397 B

date id title
20201126 097ba634-5976-437d-84c9-3bfe776df02b abstraction

Origin

Latin abstrahere "drawm from"

Definition

Hide implementation details from the user. For exapmle by extending classes.

Examples

abstract class Fish {
    swim() { return '>>>>>' }
}

class Shark extends Fish  {
    name: 'shark'
}

class Tuna extends Fish {
    name: 'tuna'
}