I want to be able to write: 开发者_Go百科 val a = Array(1,2,3) println(a.toString) And have a meaningfull printout. Is it possible?You have to do this:
How can I convert imm开发者_Go百科utable.Map to mutable.Map in Scala so I can update the values in Map?The cleanest way would be to use the mutable.Map varargs factory.Unlike the ++ approach, this use
For example, there is a Scala array val A = Array(\"please\", \"help\", \"me\"). How to choose a random element from this arra开发者_运维技巧y?import scala.util.Random
I am trying to make a code that reads the lines in file and then store it as an array in scala? The following is the code I wr开发者_Python百科ote:
I\'m quite new to Scala, 开发者_运维问答but I\'m trying to implement the following situation.Suppose I have a trait:
Why does this code crash the Scala 2.8.1 compiler? val a = new Array[{ var x = 1 }](3) Is it a compiler bug?
What does this error mean? scala> val a = Array[{ def x: Int }](new { def x = 3 }) <console>:5: error: type mismatch;
I.e. Is it possible to make a var that is not assig开发者_Python百科nable from outside of the class ?Right now, no, there\'s no way to do that.
I would like to install scala 2.8.1. I used exactly all the steps from http://www.scala-lang.org/node/310 but when i write \'scala\' in the command prompt then i have the following error
It\'s more easily explained in code: class Bippy { val x = 42 class Boppy { val y = \"hello world\" } val bop = new Boppy