Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created July 25, 2011 02:01
Show Gist options
  • Save xuwei-k/1103409 to your computer and use it in GitHub Desktop.
Save xuwei-k/1103409 to your computer and use it in GitHub Desktop.
object内での private と private[this] の違い
import scala.ScalaObject;
public final class A$
implements ScalaObject
{
private int b()
{
return b;
}
private A$()
{
}
public static final A$ MODULE$ = this;
private final int a = 1;
private final int b = 2;
static
{
new A$();
}
}
public final class A
{
}
object A{
private[this] val a = 1
private val b = 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment