Skip to content

Commit 9b684e6

Browse files
committed
Remove use of "object" and "App"
Now that Basics page has a link to ScalaFiddle, so I thought it's okay as long as it's runnable on the ScalaFiddle. Concepts like "App" is not related to the topic of this page.
1 parent ef5493d commit 9b684e6

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

tutorials/tour/unified-types.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,16 @@ The superclass of all classes `scala.Any` has two direct subclasses: `scala.AnyV
2525
Here is an example that demonstrates that strings, integers, characters, boolean values, and functions are all objects just like every other object:
2626

2727
```tut
28-
object UnifiedTypes extends App {
29-
val list: List[Any] = List(
30-
"a string",
31-
732, // an integer
32-
'c', // a character
33-
true, // a boolean value
34-
() => "an anonymous function returning a string"
35-
)
36-
37-
list.foreach(element => println(element))
38-
}
39-
```
40-
41-
The program declares an application `UnifiedTypes` in form of a top-level [singleton object](singleton-objects.html) extending [`App`](http://www.scala-lang.org/api/2.12.x/scala/App.html) so that the body of it acts as a main function.
28+
val list: List[Any] = List(
29+
"a string",
30+
732, // an integer
31+
'c', // a character
32+
true, // a boolean value
33+
() => "an anonymous function returning a string"
34+
)
35+
36+
list.foreach(element => println(element))
37+
````
4238
4339
The application defines a variable `list` of type `List[Any]`. The list is initialized with elements of various types, but they all are instance of `scala.Any`, so you can add them to the list.
4440

0 commit comments

Comments
 (0)