8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2422bcf + de33cf3 commit cf0615aCopy full SHA for cf0615a
_overviews/scala-book/collections-methods.md
@@ -210,6 +210,13 @@ scala> "bar".tail
210
res3: String = ar
211
```
212
213
+Note that like `head`, `tail` will also throw an exception when called on an empty collection:
214
+
215
+```scala
216
+scala> emptyList.tail
217
+java.lang.UnsupportedOperationException: tail of empty list
218
+```
219
220
221
222
## `take`, `takeWhile`
@@ -240,13 +247,6 @@ scala> names.takeWhile(_.length < 5)
240
247
res5: List[String] = List(joel, ed)
241
248
242
249
243
-Note that like `head`, `tail` will also throw an exception when called on an empty collection:
244
-
245
-```scala
246
-scala> emptyList.tail
-java.lang.UnsupportedOperationException: tail of empty list
-```
250
251
252
## `drop`, `dropWhile`
0 commit comments