Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object NYTimesAccount {
- private val userName = "vitthal"
- private val password = "boo"
- // Implements Factory design pattern.
- def apply() = new NYTimesAccount
- }
- class NYTimesAccount {
- private val accountDetails = Map(
- "user" -> NYTimesAccount.userName,
- "password" -> NYTimesAccount.password
- )
- println(s"Hti " + accountDetails("user"))
- }
Add Comment
Please, Sign In to add comment