Last active
August 29, 2015 13:57
-
-
Save mather/9363963 to your computer and use it in GitHub Desktop.
Scalaでは定数を含むインターフェースの継承クラスから定数を取得できない…
This file contains hidden or 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 interface A { | |
| public static final String C = "hoge"; | |
| } |
This file contains hidden or 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 class B implements A { | |
| } |
This file contains hidden or 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
| scala> A.C | |
| res0: String = hoge | |
| scala> B.C | |
| <console>:8: error: value C is not a member of object B | |
| B.C | |
| ^ | |
| scala> (new B).C | |
| <console>:8: error: value C is not a member of B | |
| (new B).C | |
| ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment