thp-lang.org/md/learn/classes/interfaces.md

26 lines
260 B
Markdown
Raw Normal View History

2023-10-05 12:56:34 +00:00
# Interfaces
```thp
interface Serializable
{
// Methods are always public in interfaces
fun serialize($) -> String
}
2023-10-24 01:39:34 +00:00
class Cat -> Serializable
2023-10-05 12:56:34 +00:00
{
pub fun Serializable($) -> String
{
// code
}
}
```
No interface inheritance.