File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ previous-page: unified-types
1919 class Point(xc: Int, yc: Int) {
2020 var x: Int = xc
2121 var y: Int = yc
22- def move(dx: Int, dy: Int) {
22+ def move(dx: Int, dy: Int): Unit = {
2323 x = x + dx
2424 y = y + dy
2525 }
@@ -33,7 +33,7 @@ previous-page: unified-types
3333클래스들은 아래의 예제가 보여주는 것처럼 새로운 기본형으로 초기화된다.
3434
3535 object Classes {
36- def main(args: Array[String]) {
36+ def main(args: Array[String]): Unit = {
3737 val pt = new Point(1, 2)
3838 println(pt)
3939 pt.move(10, 10)
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ Scala is a pure object-oriented language in the sense that
155155* everything* is an object, including numbers or functions. It
156156differs from Java in that respect, since Java distinguishes
157157primitive types (such as ` boolean ` and ` int ` ) from reference
158- types, and does not enable one to manipulate functions as values .
158+ types.
159159
160160### Numbers are objects
161161
@@ -190,7 +190,7 @@ prevents `1` from being interpreted as a `Double`.
190190
191191### Functions are objects
192192
193- Perhaps more surprising for the Java programmer, functions are also
193+ Functions are also
194194objects in Scala. It is therefore possible to pass functions as
195195arguments, to store them in variables, and to return them from other
196196functions. This ability to manipulate functions as values is one of
You can’t perform that action at this time.
0 commit comments