added constructors for enums
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
enum Color {
|
||||
private int code;
|
||||
|
||||
private Color(int c) {
|
||||
code = c;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
enum Color(c : Int) {
|
||||
private var code : Int
|
||||
open public fun getCode() : Int {
|
||||
return code
|
||||
}
|
||||
{
|
||||
$code = c
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user