Created
July 25, 2011 02:01
-
-
Save xuwei-k/1103409 to your computer and use it in GitHub Desktop.
object内での private と private[this] の違い
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
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$(); | |
} | |
} |
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 final class 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
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