From aa3e128b980a5beb8b2b9360938a138e7acdbf5c Mon Sep 17 00:00:00 2001 From: anxious gritt Date: Sun, 26 Sep 2021 16:59:27 +0500 Subject: [PATCH 1/5] improvement:operators lesson --- .vscode/settings.json | 3 +++ lessons/operators.md | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..6f3a2913 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "liveServer.settings.port": 5501 +} \ No newline at end of file diff --git a/lessons/operators.md b/lessons/operators.md index a434f6a0..5cd1e2b7 100644 --- a/lessons/operators.md +++ b/lessons/operators.md @@ -70,8 +70,9 @@ Relational operators are used to compare the values of two operands. They are us Logical operators are used to perform logical operations. They are used to perform the following operations: -- `&&`: AND used to perform logical AND operation. It gives true if both the operands have true value. -- `||`: OR used to perform logical OR operation. It gives true if either of the operands have true value. +- `&&` and `&`: Java unlike many other languages has two AND operators to perform logical AND operation. It returns true if both the operands (being compared) have a truthy value.Even though both the `&` and `&&` operators perform the same AND operation ; the `&&` operator can improve the efficiency of your code since it evaluates the second expression only if the first expression is true unlike the `&` operator which evaluates the second expression nonetheless. + +- `||` and `|`: OR used to perform logical OR operation. It returns true if either of the operands have a truthy value. The difference between `|` and `||` is that the `|` operator is a bitwise operator and it compares each operand bitwise whereas the `||` operator is the logical OR operator. It operates on both the operands and returns true if either of the operands have a truthy value. - `!`: NOT used to perform logical NOT operation. It gives true if the operand has false value. let's see an example: From 874de2dbdf856818ee50aaa1b8899a666142ba88 Mon Sep 17 00:00:00 2001 From: anxious gritt Date: Sun, 26 Sep 2021 17:04:43 +0500 Subject: [PATCH 2/5] mention bitwise and logical operators --- lessons/operators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/operators.md b/lessons/operators.md index 5cd1e2b7..4c3ba66a 100644 --- a/lessons/operators.md +++ b/lessons/operators.md @@ -70,7 +70,7 @@ Relational operators are used to compare the values of two operands. They are us Logical operators are used to perform logical operations. They are used to perform the following operations: -- `&&` and `&`: Java unlike many other languages has two AND operators to perform logical AND operation. It returns true if both the operands (being compared) have a truthy value.Even though both the `&` and `&&` operators perform the same AND operation ; the `&&` operator can improve the efficiency of your code since it evaluates the second expression only if the first expression is true unlike the `&` operator which evaluates the second expression nonetheless. +- `&&` and `&`: Java unlike many other languages has two AND operators to perform logical AND operation. It returns true if both the operands (being compared) have a truthy value.Even though both the `&` and `&&` operators perform the same AND operation ; the `&&` operator is a logical operator and it can improve the efficiency of your code since it evaluates the second expression only if the first expression is true unlike the bitwise `&` operator which evaluates the second expression nonetheless. - `||` and `|`: OR used to perform logical OR operation. It returns true if either of the operands have a truthy value. The difference between `|` and `||` is that the `|` operator is a bitwise operator and it compares each operand bitwise whereas the `||` operator is the logical OR operator. It operates on both the operands and returns true if either of the operands have a truthy value. - `!`: NOT used to perform logical NOT operation. It gives true if the operand has false value. From 61e50b21a7cd87c7ba08e985df729c8bb6d79cdf Mon Sep 17 00:00:00 2001 From: anxious gritt Date: Sun, 26 Sep 2021 17:08:00 +0500 Subject: [PATCH 3/5] fix grammar mistake --- lessons/operators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/operators.md b/lessons/operators.md index 4c3ba66a..3ff78b45 100644 --- a/lessons/operators.md +++ b/lessons/operators.md @@ -72,7 +72,7 @@ Logical operators are used to perform logical operations. They are used to perfo - `&&` and `&`: Java unlike many other languages has two AND operators to perform logical AND operation. It returns true if both the operands (being compared) have a truthy value.Even though both the `&` and `&&` operators perform the same AND operation ; the `&&` operator is a logical operator and it can improve the efficiency of your code since it evaluates the second expression only if the first expression is true unlike the bitwise `&` operator which evaluates the second expression nonetheless. -- `||` and `|`: OR used to perform logical OR operation. It returns true if either of the operands have a truthy value. The difference between `|` and `||` is that the `|` operator is a bitwise operator and it compares each operand bitwise whereas the `||` operator is the logical OR operator. It operates on both the operands and returns true if either of the operands have a truthy value. +- `||` and `|`: OR is used to perform logical OR operation. It returns true if either of the operands have a truthy value. The difference between `|` and `||` is that the `|` operator is a bitwise operator and it compares each operand bitwise whereas the `||` operator is the logical OR operator. It operates on both the operands and returns true if either of the operands have a truthy value. - `!`: NOT used to perform logical NOT operation. It gives true if the operand has false value. let's see an example: From 535651ae31faa0dae8e824af26f57b1ef0eccbfd Mon Sep 17 00:00:00 2001 From: anxious gritt Date: Sun, 26 Sep 2021 20:27:32 +0500 Subject: [PATCH 4/5] remove vscode settings file --- .vscode/settings.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 6f3a2913..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "liveServer.settings.port": 5501 -} \ No newline at end of file From 61880176b7eff7f4499267dbe24d1da443180571 Mon Sep 17 00:00:00 2001 From: Utkarsh Mishra <76392681+Utkarsh1504@users.noreply.github.com> Date: Sun, 26 Sep 2021 21:33:24 +0530 Subject: [PATCH 5/5] indentation fixed --- lessons/operators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lessons/operators.md b/lessons/operators.md index 3ff78b45..aaaf3ed2 100644 --- a/lessons/operators.md +++ b/lessons/operators.md @@ -70,7 +70,7 @@ Relational operators are used to compare the values of two operands. They are us Logical operators are used to perform logical operations. They are used to perform the following operations: -- `&&` and `&`: Java unlike many other languages has two AND operators to perform logical AND operation. It returns true if both the operands (being compared) have a truthy value.Even though both the `&` and `&&` operators perform the same AND operation ; the `&&` operator is a logical operator and it can improve the efficiency of your code since it evaluates the second expression only if the first expression is true unlike the bitwise `&` operator which evaluates the second expression nonetheless. +- `&&` and `&`: Java unlike many other languages has two AND operators to perform logical AND operation. It returns true if both the operands (being compared) have a truthy value. Even though both the `&` and `&&` operators perform the same AND operation; the `&&` operator is a logical operator and it can improve the efficiency of your code since it evaluates the second expression only if the first expression is true unlike the bitwise `&` operator which evaluates the second expression nonetheless. - `||` and `|`: OR is used to perform logical OR operation. It returns true if either of the operands have a truthy value. The difference between `|` and `||` is that the `|` operator is a bitwise operator and it compares each operand bitwise whereas the `||` operator is the logical OR operator. It operates on both the operands and returns true if either of the operands have a truthy value. - `!`: NOT used to perform logical NOT operation. It gives true if the operand has false value.