Skip to content

Instantly share code, notes, and snippets.

@shomah4a
Created December 8, 2011 07:16
Show Gist options
  • Save shomah4a/1446366 to your computer and use it in GitHub Desktop.
Save shomah4a/1446366 to your computer and use it in GitHub Desktop.
import の挙動とか
package aaaaa;
public class StaticClass
{
public static String someValue = null;
public static void updateSomeValue(String value)
{
someValue = value;
}
public static String getSomeValue()
{
return someValue;
}
}
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