저는 스칼라를 처음 접했습니다. 파이썬에서 왔고 문법과 규칙을 고수하려고했습니다.List [Int] .apply (1,2,3)가 Scala에서 오류를 발생시키는 이유는 무엇입니까?
scala> val tmp = List.apply(1,2,3)
tmp: List[Int] = List(1,2,3)
scala> val tmp = List[Int](1,2,3)
tmp: List[Int] = List(1,2,3)
왜 List[Int].apply()
나에게 오류를 제공 않습니다 : 나는 다음 작업을 수행 할 때
scala> val tmp = List[Int].apply(1,2,3)
<console>:7: error: missing arguments for method apply in object List;
follow this method with `_' if you want to treat it as a partially applied function
val tmp = List[Int].apply(1,2,3)
그러나, 나는 오류를 얻을 : 다음 작동하지 않는 이유가 궁금 하군요?
도움 주셔서 감사합니다.
아, 정말 고마워! – aaronlevin