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.
1 parent 02df798 commit b6e2e6fCopy full SHA for b6e2e6f
_ja/tour/basics.md
@@ -171,12 +171,17 @@ println("Hello, " + name + "!")
171
メソッドと関数には他にも違いがありますが、今のところは同じようなものと考えて大丈夫です。
172
173
メソッドは複数行の式も持つことができます。
174
+
175
+{% scalafiddle %}
176
```tut
177
def getSquareString(input: Double): String = {
178
val square = input * input
179
square.toString
180
}
181
+println(getSquareString(2.5)) // 6.25
182
```
183
+{% endscalafiddle %}
184
185
メソッド本体にある最後の式はメソッドの戻り値になります。(Scalaには`return`キーワードはありますが、めったに使われません。)
186
187
## クラス
0 commit comments