object Main extends App { val a = List(1, 2, 3, 4, 5); val b = a.map(num => 2*num); println(a); println(b);}
Standard input is empty
List(1, 2, 3, 4, 5) List(2, 4, 6, 8, 10)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!