Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Functions {
- def addOne(x: Int): Int = {
- x + 1
- }
- }
- class AddOne(lst: List[Int]) {
- import Functions._
- lst map addOne foreach println
- }
- new AddOne(List(0, 1, 2, 3, 4, 5, 6))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement