wiki/content/20201126102708-abstraction.md

31 lines
399 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-29 18:27:12 +00:00
date: 2020-11-26
2024-05-06 20:40:05 +00:00
id: 097ba634-5976-437d-84c9-3bfe776df02b
title: abstraction
---
# Origin
Latin abstrahere "drawm from"
# Definition
Hide implementation details from the user. For exapmle by extending
classes.
# Examples
``` typescript
abstract class Fish {
swim() { return '>>>>>' }
}
class Shark extends Fish {
name: 'shark'
}
class Tuna extends Fish {
name: 'tuna'
}
```