mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 10:01:38 +00:00
[scala/en] Add missing class instantiation and fix typos (#4193)
* [scala/en] Add missing class instantiation * [scala/en] Remove parens from object instantiation to keep with style of rest of the page * [scala/en] Fix typos
This commit is contained in:
parent
eed9734dfc
commit
5e1e2a0a15
@ -481,7 +481,7 @@ class SaintBernard extends Dog {
|
|||||||
def bite = false
|
def bite = false
|
||||||
}
|
}
|
||||||
|
|
||||||
scala> b
|
scala> val b = new SaintBernard
|
||||||
res0: SaintBernard = SaintBernard@3e57cd70
|
res0: SaintBernard = SaintBernard@3e57cd70
|
||||||
scala> b.breed
|
scala> b.breed
|
||||||
res1: String = Saint Bernard
|
res1: String = Saint Bernard
|
||||||
@ -599,7 +599,7 @@ List("Dom", "Bob", "Natalia") foreach println
|
|||||||
|
|
||||||
s.map(sq)
|
s.map(sq)
|
||||||
|
|
||||||
val sSquared = s. map(sq)
|
val sSquared = s.map(sq)
|
||||||
|
|
||||||
sSquared.filter(_ < 10)
|
sSquared.filter(_ < 10)
|
||||||
|
|
||||||
@ -717,7 +717,7 @@ import scala.collection.immutable.{Map => _, Set => _, _}
|
|||||||
// Java classes can also be imported. Scala syntax can be used
|
// Java classes can also be imported. Scala syntax can be used
|
||||||
import java.swing.{JFrame, JWindow}
|
import java.swing.{JFrame, JWindow}
|
||||||
|
|
||||||
// Your programs entry point is defined in a scala file using an object, with a
|
// Your program's entry point is defined in a scala file using an object, with a
|
||||||
// single method, main:
|
// single method, main:
|
||||||
object Application {
|
object Application {
|
||||||
def main(args: Array[String]): Unit = {
|
def main(args: Array[String]): Unit = {
|
||||||
|
Loading…
Reference in New Issue
Block a user