Relational operators are primarily judged by the value, that is, to determine whether the two values are equal, if the equality will be true (true), if not equal false (false). Relational operators the only two values that he came up with, true and false, simply say that he is used to make judgments, to judge whether the choice is in accordance with the requirements, if it is true or right, does not meet the requirements that is false or wrong, true to represent, false for false to represent.
In fact, every moment in life we are also making judgments, such as: if you pay today to go to the supermarket to buy things, if not pay so do not go to the supermarket, if today throws a coin is positive don't learn, if throw opposite that learn. So he has to make judgments in life, and in our programming we make judgments every moment of the day.
Relational operators:> <= =! = (Single-weight meaning, only one condition of judgment), >= <= (double meaning, ask two conditions).
What is the double meaning, for example: we go to the supermarket, we can determine whether the money inside our pocket is greater than or equal to 100, (greater than 100 is and greater than or equal to 100 meaning is not the same, greater than 100 must be 100 above does not contain 100, and greater than or equal to 100 is 100 or 100). If the value is greater than or equal to 100, you can go to the supermarket if it is 100 or more. So it means that you can satisfy me. This is the double meaning, as long as two kinds of satisfying one can be.
Another example: Do you have a car or do you have a house? You said you didn't have a car, but you had a house. If you say you have a car without a house, you can meet the requirements, but you said you didn't have a car or a house. Then you go, don't come to me again.
The relational operator is used to judge whether your condition satisfies his requirements, if satisfied is true, if it is not satisfied as false. 4.5 is shown below:
650) this.width=650; "src=" Http://img.mp.itc.cn/upload/20160422/3cf8767714884c0ea01be5b6073292fc.jpg "style=" border:0px;margin:0px;padding:0px;font-size:0px; "/>
Figure 4.5
In life or in the program we are in every moment of judgment, you go to the Internet cafes to play games, if you are 18 years old then you can play, if not full 18 years old can not. Program is the same, the program he is the way to simulate life to judge, if the login input password wrong then will not login, if you click OK he will give you to execute, if you click Cancel he will give you off. So no matter what you do can not be separated from judgment, judgment must use the relational operator to judge.
Technology sharing: www.kaige123.com
This article is from the "11247808" blog, please be sure to keep this source http://11257808.blog.51cto.com/11247808/1890237
Java Relational operators