7
例如:在REPL中找到的類型?
scala> val b = new ArrayBuffer[Int]()
<console>:7: error: not found: type ArrayBuffer
val b = new ArrayBuffer[Int]()
^
我可以使用REPL找到ArrayBuffer的完整路徑和進口嗎?
例如:在REPL中找到的類型?
scala> val b = new ArrayBuffer[Int]()
<console>:7: error: not found: type ArrayBuffer
val b = new ArrayBuffer[Int]()
^
我可以使用REPL找到ArrayBuffer的完整路徑和進口嗎?
您需要import scala.collection.mutable.ArrayBuffer
,scala.collection.mutable的類(和對象)默認情況下不會導入。
您可以使用[scalex.org](http://scalex.org) – 4e6
任何IDE都能夠自動導入並具有歧義解析功能(畢竟,這就是包的要點),但是我不要認爲REPL是先進的。在有人開發下一代超級REPL之前,我會使用scala API文檔,並保持在瀏覽器選項卡中打開。 –