I started the scala REPL an write the following code:
scala> val a = Array(1,2,3,4)
a: Array[Int] = Array(1, 2, 3, 4)
scala> a.`<TAB>`
asInstanceOf getClass isInstanceOf toString
scala> a.exists(_ == 1)
res1: Boolean = true
Why I don't have "exists" listed when I press <TAB>?
I think it because Array do not have 'exists' method. 'exists' method is belong to ArrayOps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.