ZenScript main repository
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

interfaces.zs 303B

1234567891011121314151617
  1. public interface MyInterface {
  2. interfaceMethod() as string;
  3. }
  4. public class MyClass {
  5. val name as string;
  6. public this(name as string) {
  7. this.name = name;
  8. }
  9. public implements MyInterface {
  10. interfaceMethod() => "InterfaceMethod " + name;
  11. }
  12. }
  13. println(new MyClass("hello").interfaceMethod());