Skip to content

improve: the explanations of the logical operators AND and OR: && vs. & and || vs. | #8

Closed
@Guannan-Shen

Description

@Guannan-Shen

⭐ Summary

Descriptions of &&(AND) and || (OR) might be misleading and less accurate:

- `&&`: 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.

For instance, || gives true if the 1st operand has a true value, and it will not try to evaluate the 2nd operand.
It might be helpful to mention & and | first, and then present a comparison between & and &&, as well as | and ||.

💻 Location

See following markdown files:

https://github.com/Utkarsh1504/DSA-Java/blob/main/lessons/operators.md?plain=1#L73

https://github.com/Utkarsh1504/DSA-Java/blob/main/lessons/operators.md?plain=1#L74

❌ Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    easyeasy to contributegood first issueGood for newcomershelp wantedExtra attention is neededneeds improvementfor improving the website's content

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions