Created
December 8, 2011 07:16
-
-
Save shomah4a/1446366 to your computer and use it in GitHub Desktop.
import の挙動とか
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
package aaaaa; | |
public class StaticClass | |
{ | |
public static String someValue = null; | |
public static void updateSomeValue(String value) | |
{ | |
someValue = value; | |
} | |
public static String getSomeValue() | |
{ | |
return someValue; | |
} | |
} |
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
import static aaaaa.StaticClass.*; | |
public class Test | |
{ | |
public static void main(String[] argv) | |
{ | |
System.out.println(someValue); // null | |
updateSomeValue("aaaa"); | |
System.out.println(someValue); // python 的感覚だとここも null | |
// でもそうじゃない | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment