From 0478bd41ccfefce54a13cd16384d375ba9b7f015 Mon Sep 17 00:00:00 2001 From: ECMA13 Date: Wed, 29 Nov 2023 10:56:30 +0800 Subject: [PATCH 1/2] Fix typos on 2.4 --- data/part-2/4-methods.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/part-2/4-methods.md b/data/part-2/4-methods.md index fb04c168..862e4247 100644 --- a/data/part-2/4-methods.md +++ b/data/part-2/4-methods.md @@ -64,7 +64,7 @@ import java.util.Scanner; public class Example { public static void main(String[] args) { - Scanner scanned = new Scanner(System.in); + Scanner scanner = new Scanner(System.in); // program code } @@ -1885,7 +1885,7 @@ Let's observe the same program by visualizing its execution step-by-step. The ap -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. +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. -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. +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. @@ -1105,7 +1105,7 @@ int number = 7; if (number >= 5 && number <= 10) { System.out.println("It is! :)"); } else { - System.out.println("It is not :(") + System.out.println("It is not :("); } ``` @@ -1127,7 +1127,7 @@ int luku = 145; if (luku < 0 || luku > 100) { System.out.println("On! :)"); } else { - System.out.println("Ei ollut :(") + System.out.println("Ei ollut :("); } ``` --> @@ -1138,7 +1138,7 @@ int number = 145; if (number < 0 || number > 100) { System.out.println("It is! :)"); } else { - System.out.println("It is not :(") + System.out.println("It is not :("); } ``` @@ -1159,7 +1159,7 @@ int luku = 7; if (!(luku > 4)) { System.out.println("Luku ei ole suurempi kuin 4."); } else { - System.out.println("Luku on suurempi tai yhtäsuuri kuin 4.") + System.out.println("Luku on suurempi tai yhtäsuuri kuin 4."); } ``` --> @@ -1169,7 +1169,7 @@ int number = 7; if (!(number > 4)) { System.out.println("The number is not greater than 4."); } else { - System.out.println("The number is greater than 4.") + System.out.println("The number is greater than 4."); } ```