Skip to content

Instantly share code, notes, and snippets.

@yoshiori
Created May 10, 2021 10:58
Show Gist options
  • Save yoshiori/9d23fc4d840b079b10bb4040fb7ff563 to your computer and use it in GitHub Desktop.
Save yoshiori/9d23fc4d840b079b10bb4040fb7ff563 to your computer and use it in GitHub Desktop.
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