26 lines
261 B
Markdown
26 lines
261 B
Markdown
|
# Interfaces
|
||
|
|
||
|
|
||
|
|
||
|
```thp
|
||
|
interface Serializable
|
||
|
{
|
||
|
// Methods are always public in interfaces
|
||
|
fun serialize($) -> String
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
class Cat -> Serializable,
|
||
|
{
|
||
|
pub fun Serializable($) -> String
|
||
|
{
|
||
|
// code
|
||
|
}
|
||
|
}
|
||
|
|
||
|
```
|
||
|
|
||
|
No interface inheritance.
|
||
|
|