Merge: doc: fixed some typos and other misc. corrections
[nit.git] / examples / rosettacode / abstract_type.nit
1 #!/usr/bin/env nit
2 #
3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
5
6 # Task: abstract type
7 # SEE: <http://rosettacode.org/wiki/Abstract_type>
8 #
9 # Methods withouts implementation are annotated `abstract`.
10 #
11 # Abstract classes and interfaces can contain abstract methods and concrete (i.e. non-abstract) methods.
12 # Abstract classes can also have attributes.
13 module abstract_type
14
15 interface Inter
16 fun method1: Int is abstract
17 fun method2: Int do return 1
18 end
19
20 abstract class Abs
21 fun method1: Int is abstract
22 fun method2: Int do return 1
23 var attr: Int
24 end