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 ff1b162 + 4684047 commit 7610b0aCopy full SHA for 7610b0a
web/basics2.textile
@@ -16,12 +16,19 @@ This lesson covers:
16
17
h2(#apply). apply methods
18
19
-apply methods give you a nice syntatic sugar for when a class or object has one main use.
+apply methods give you a nice syntactic sugar for when a class or object has one main use.
20
21
<pre>
22
+class Foo {}
23
+
24
object FooMaker {
25
def apply() = new Foo
26
}
27
+</pre>
28
29
+or
30
31
+<pre>
32
33
scala> class Bar {
34
| def apply() = 0
0 commit comments