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

26 lines
258 B
Markdown
Raw Normal View History

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