Lesson+8


 * Lesson 8 The boolean Type and boolean Operators**


 * Boolean has only two values True or False.
 * If Both part are true then the statement is true.
 * If both parts are false then the statement is false.
 * If its true and false everything is false.
 * If its true or false everything is true.


 * and** is written as **&&**
 * or** is written as **||**
 * not** is written as **!**

>is greater than
 * <** is less than

14. //System.out.println( (true && false) | | ( (true && true) | | false ) );// The answer is true. explanation: the answer is true because we need to do the **&&** first so **true && false** is **false** and then we do the other **&&** a **true && true** is **true**, until this point we are done with the **&&** now we move on to the **||**. Now we get the answers for the **&&** that were done before which were **false** and **true**, so a **false || true** is **true** and now we only do **true || false** which is **true** our final answer. In this problem we apply the **operator precedence.**

This is an example in which we are going to be using ==, **not (!):** System.out.println(!(1 == 0)); //**true** *in this example the answer is **true** because 1 is not equal to 0 which is **false** but you have a **not (!)** and the opposite of false is **true.**//
 * When you are saying in java a number is equal to you need to use == because = is the assignment operator and you won't be able to run it.

we had learn about **&&, ||, ==, !=, !** but which one suppose to be done first?? The order is//: **!, ==, !=, &&, ||**// //example: System.out.println(true || true && false);//true explanation: in this case you do first the **&&** because they come first than the **||**, so **true && false** is **false** then you continue to the other part which would be the **||**, so **false || true** is **true** the final answer.
 * **Operator precedence:**