Created
May 10, 2021 10:58
-
-
Save yoshiori/9d23fc4d840b079b10bb4040fb7ff563 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum Hoge implements Runnable{ | |
FOO("foo"){ | |
@Override | |
public void run() { | |
// 何か処理 | |
} | |
@Override | |
public String getAddress() { | |
return address; | |
} | |
}, | |
BAR("bar"){ | |
@Override | |
public void run() { | |
// 何か処理 | |
} | |
@Override | |
public String getAddress() { | |
return address + "bar"; | |
} | |
}; | |
final String address; | |
Hoge(String address){ | |
this.address = address; | |
} | |
abstract String getAddress(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment