Guest User

Untitled

a guest
Dec 22nd, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. object NYTimesAccount {
  2.  
  3. private val userName = "vitthal"
  4. private val password = "boo"
  5.  
  6. // Implements Factory design pattern.
  7. def apply() = new NYTimesAccount
  8.  
  9. }
  10.  
  11. class NYTimesAccount {
  12. private val accountDetails = Map(
  13. "user" -> NYTimesAccount.userName,
  14. "password" -> NYTimesAccount.password
  15. )
  16. println(s"Hti " + accountDetails("user"))
  17. }
Add Comment
Please, Sign In to add comment