You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/part-2/4-methods.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ import java.util.Scanner;
64
64
65
65
publicclassExample {
66
66
publicstaticvoidmain(String[] args) {
67
-
Scannerscanned=newScanner(System.in);
67
+
Scannerscanner=newScanner(System.in);
68
68
// program code
69
69
}
70
70
@@ -1885,7 +1885,7 @@ Let's observe the same program by visualizing its execution step-by-step. The ap
1885
1885
1886
1886
<!-- Tarkastellaan seuraavaksi esimerkkiä, missä metodi palauttaa arvon. Ohjelman `main`-metodi kutsuu erillistä `kaynnista`-metodia, jossa luodaan kaksi muuttujaa, kutsutaan `summa`-metodia, ja tulostetaan `summa`-metodin palauttama arvo. -->
1887
1887
1888
-
Let's now study an example where the method returns a value. The `main` method of the program calls a separate `start` method, inside of which two variables are created, the `sum` method is called, and the the value returned by the `sum` method is printed.
1888
+
Let's now study an example where the method returns a value. The `main` method of the program calls a separate `start` method, inside of which two variables are created, the `sum` method is called, and the value returned by the `sum` method is printed.
1889
1889
1890
1890
<!-- ```java
1891
1891
public static void main(String[] args) {
@@ -1959,7 +1959,7 @@ main
1959
1959
1960
1960
<!-- Komento `int summa = summa(eka, toka);` luo metodiin `kaynnista` muuttujan `summa`, ja kutsuu metodia `summa`. Metodi `kaynnista` jää odottamaan. Koska metodissa `summa` on määritelty parametrit `luku1` ja `luku2`, luodaan ne heti metodin suorituksen alussa, ja niihin kopioidaan parametrina annettujen muuttujien arvot. -->
1961
1961
1962
-
The command `int sum = sum(first, second);` creates the variable `sum` in the method `start` and calls the method `sum`. The method `start` enters a waiting state. Since the parameters `number1` and `number2` are defined in the method `sum`, they are created right at the beginning of the method's execution, after which the values of the variables given as parametes are copied into them.
1962
+
The command `int sum = sum(first, second);` creates the variable `sum` in the method `start` and calls the method `sum`. The method `start` enters a waiting state. Since the parameters `number1` and `number2` are defined in the method `sum`, they are created right at the beginning of the method's execution, after which the values of the variables given as parameters are copied into them.
0 commit comments