10000 Simplify main methods section · soronpo/scala.github.com@0efb6e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0efb6e4

Browse files
committed
Simplify main methods section
1 parent 5f4db60 commit 0efb6e4

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

tutorials/tour/basics.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,20 +252,10 @@ We will cover traits in depth [later](traits.md).
252252

253253
## Main Method
254254

255-
Using singleton objects, you can define main methods like below.
255+
Using objects, you can define main methods like below.
256256

257257
```
258258
object Main {
259-
def main(args: Array[String]): Unit = {
260-
println("Hello, world!")
261-
}
262-
}
263-
```
264-
265-
Because every runnable application has a main method, Scala also provides a more convenient way of defining your main method by extending `App` trait.
266-
267-
```
268-
object Main extends App {
269-
println("Hello, world!")
259+
def main(args: Array[String]): Unit = println("Hello, Scala developer!")
270260
}
271261
```

0 commit comments

Comments
 (0)
0