From fd43edcf6875d2fc9b555a13c031cbb4e80e80fa Mon Sep 17 00:00:00 2001 From: Rifat <76785992+ChrolloRifat@users.noreply.github.com> Date: Fri, 11 Aug 2023 19:55:28 +0600 Subject: [PATCH 1/6] Update introduction.md --- concepts/basics/introduction.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/concepts/basics/introduction.md b/concepts/basics/introduction.md index 65fe8a965..cb2a5282d 100644 --- a/concepts/basics/introduction.md +++ b/concepts/basics/introduction.md @@ -1,22 +1,22 @@ # Introduction -Java is a statically-typed language, which means that everything has a type at compile-time. Assigning a value to a name is referred to as defining a variable. A variable is defined by explicitly specifying its type. +Java is a statically-typed language, which means that the type of a variable is known at compile-time. Assigning a value to a name is referred to as defining a variable. A variable is defined by explicitly specifying its type. ```java int explicitVar = 10; ``` -Updating a variable's value is done through the `=` operator. Once defined, a variable's type can never change. +Updating a variable's value is done through the `=` operator. Here, `=` does not represent mathematical equality. It simply assigns a value to a variable. Once defined, a variable's type can never change. ```java int count = 1; // Assign initial value count = 2; // Update to new value -// Compiler error when assigning different type +// Compiler error when assigning a different type // count = false; ``` -Java is an [object-oriented language][object-oriented-programming] and requires all functions to be defined in a _class_. The `class` keyword is used to define a class. +Java is an [object-oriented language][object-oriented programming] and requires all functions to be defined in a _class_. The `class` keyword is used to define a class. ```java class Calculator { @@ -24,7 +24,7 @@ class Calculator { } ``` -A function within a class is referred to as a _method_. Each method can have zero or more parameters. All parameters must be explicitly typed, there is no type inference for parameters. Similarly, the return type must also be made explicit. Values are returned from functions using the `return` keyword. To allow a method to be called by other classes, the `public` access modifier must be added. +A function within a class is referred to as a _method_. Each _method_ can have zero or more parameters. All parameters must be explicitly typed, there is no type inference for parameters. Similarly, the return type must also be made explicit. Values are returned from _methods_ using the `return` keyword. To allow a _method_ to be called by other classes, the `public` access modifier must be added. ```java class Calculator { From 855edfc719f0d400d9d35388a6ccbd9d2f82251f Mon Sep 17 00:00:00 2001 From: Rifat <76785992+ChrolloRifat@users.noreply.github.com> Date: Mon, 14 Aug 2023 22:27:02 +0600 Subject: [PATCH 2/6] Fix a typo --- exercises/concept/annalyns-infiltration/.docs/instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/concept/annalyns-infiltration/.docs/instructions.md b/exercises/concept/annalyns-infiltration/.docs/instructions.md index 6f5503cfa..4ae00ea14 100644 --- a/exercises/concept/annalyns-infiltration/.docs/instructions.md +++ b/exercises/concept/annalyns-infiltration/.docs/instructions.md @@ -53,7 +53,7 @@ AnnalynsInfiltration.canSignalPrisoner(archerIsAwake, prisonerIsAwake); ## 4. Check if the prisoner can be freed -Implement the (_static_) `AnnalynsInfiltration.canFreePrisoner()` method that takes four boolean values. The first three parameters indicate if the knight, archer and the prisoner, respectively, are awake. The last parameter indicates if Annalyn's pet dog is present. The method returns `true` if the prisoner can be freed based on the state of the three characters and Annalyn's pet dog presence. Otherwise, it returns `false`: +Implement the (_static_) `AnnalynsInfiltration.canFreePrisoner()` method that takes four boolean values. The first three parameters indicate if the knight, archer and the prisoner, respectively, are awake. The last parameter indicates if Annalyn's pet dog is present. The method returns `true` if the prisoner can be freed based on the state of the three characters and Annalyn's pet dog's presence. Otherwise, it returns `false`: ```java boolean knightIsAwake = false; From 484bf4f17b2a6b45b733876e272f0a99ad7ffb2e Mon Sep 17 00:00:00 2001 From: Rifat <76785992+ChrolloRifat@users.noreply.github.com> Date: Fri, 25 Aug 2023 00:22:16 +0600 Subject: [PATCH 3/6] Update introduction.md --- concepts/basics/introduction.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/concepts/basics/introduction.md b/concepts/basics/introduction.md index cb2a5282d..afe3beff8 100644 --- a/concepts/basics/introduction.md +++ b/concepts/basics/introduction.md @@ -24,7 +24,7 @@ class Calculator { } ``` -A function within a class is referred to as a _method_. Each _method_ can have zero or more parameters. All parameters must be explicitly typed, there is no type inference for parameters. Similarly, the return type must also be made explicit. Values are returned from _methods_ using the `return` keyword. To allow a _method_ to be called by other classes, the `public` access modifier must be added. +A function within a class is referred to as a _method_. Each method can have zero or more parameters. All parameters must be explicitly typed, there is no type inference for parameters. Similarly, the return type must also be made explicit. Values are returned from methods using the `return` keyword. To allow a method to be called by other classes, the `public` access modifier must be added. ```java class Calculator { @@ -34,10 +34,10 @@ class Calculator { } ``` -Invoking a method is done by specifying its class and method name and passing arguments for each of the method's parameters. +Invoking/calling a method is done by specifying its class and method name and passing arguments for each of the method's parameters. ```java -int sum = new Calculator().add(1, 2); +int sum = new Calculator().add(1, 2); // here the "add" method has been called to perform the task of addition ``` Scope in Java is defined between the `{` and `}` characters. From c69e9cefee7453864d80603f2ab772cc68ca69aa Mon Sep 17 00:00:00 2001 From: Rifat <76785992+ChrolloRifat@users.noreply.github.com> Date: Sat, 26 Aug 2023 22:13:32 +0600 Subject: [PATCH 4/6] Update introduction.md --- concepts/basics/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concepts/basics/introduction.md b/concepts/basics/introduction.md index afe3beff8..c8b459037 100644 --- a/concepts/basics/introduction.md +++ b/concepts/basics/introduction.md @@ -16,7 +16,7 @@ count = 2; // Update to new value // count = false; ``` -Java is an [object-oriented language][object-oriented programming] and requires all functions to be defined in a _class_. The `class` keyword is used to define a class. +Java is an [object-oriented language][object-oriented-programming] and requires all functions to be defined in a _class_. The `class` keyword is used to define a class. ```java class Calculator { From 854fc89e8373593b2d7d64b258b4b238d237dbea Mon Sep 17 00:00:00 2001 From: Vidar Date: Thu, 12 Jun 2025 23:00:39 +0600 Subject: [PATCH 5/6] Update concepts/basics/introduction.md Co-authored-by: Kah Goh --- concepts/basics/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concepts/basics/introduction.md b/concepts/basics/introduction.md index c8b459037..3d814c6c1 100644 --- a/concepts/basics/introduction.md +++ b/concepts/basics/introduction.md @@ -34,7 +34,7 @@ class Calculator { } ``` -Invoking/calling a method is done by specifying its class and method name and passing arguments for each of the method's parameters. +Invoking (or calling) a method is done by specifying its class and method name and passing arguments for each of the method's parameters. ```java int sum = new Calculator().add(1, 2); // here the "add" method has been called to perform the task of addition From 401fd2b799767faed771eb3c1a879169b97930d7 Mon Sep 17 00:00:00 2001 From: Vidar Date: Thu, 12 Jun 2025 23:06:02 +0600 Subject: [PATCH 6/6] Update concepts/basics/introduction.md Co-authored-by: Kah Goh --- concepts/basics/introduction.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/concepts/basics/introduction.md b/concepts/basics/introduction.md index 3d814c6c1..feee6592e 100644 --- a/concepts/basics/introduction.md +++ b/concepts/basics/introduction.md @@ -37,7 +37,8 @@ class Calculator { Invoking (or calling) a method is done by specifying its class and method name and passing arguments for each of the method's parameters. ```java -int sum = new Calculator().add(1, 2); // here the "add" method has been called to perform the task of addition +// call "add" method to perform addition +int sum = new Calculator().add(1, 2); ``` Scope in Java is defined between the `{` and `}` characters.