15.09.29

Source: Internet
Author: User

Comparison operator SYSTEM.OUT.PRINTLN ("1! = 0 =" + (1!=0));         System.out.println ("1 > 0 =" + (1>0));         string GG = "SDSD";  String ff = "SDSD";          logical operator int BIJIAO1 = 10;          int Bijiao2 = 0;                   int Bijiao3 = 20; && Short-circuit notation: Judging from left to right, as long as there is a false, then the result will be directly output, will not continue the backward operation//logic and Operation System.out.println ("Tru         E && true = "+ (true&&true));         System.out.println ("true && false =" + (true&&false));         System.out.println ("false && false =" + (false&&false));         System.out.println ("False && false && true =" + (False && false && true)); System.out.println ("True && true && false =" + ((bijiao1>0) && (Bijiao2 = = 0) && (bijiao                  (3<0)));  //   || Short-circuit notation: Judging from left to right, as long as there is a true, then the result will be directly output, will not continue the backward operation//logic or Operation System.out.println ("true | | TruE = "+ (true | |         true)); System.out.println ("true | | false = "+ (true | |         false)); System.out.println ("false | | false = "+ (false| |         false)); System.out.println ("false | | False | | true = "+ (false| | False | |                           true));         Logical non-operational System.out.println ("!true =" +!true);               System.out.println ("!false =" +!false); Ternary operator?                  : int f = 0;                  if (age >) {f=age;                 } else {f = 0;  } System.out.println ("f =" +f);          Operator Precedence class//data type conversion int DJD = 999;                    Implicit conversion of long GJD = DJD;                    explicitly convert int djd1 = (int) Gjd;                                    Implicit conversion of float higher than long float fl = GJD;         Double db = FL;                 System.out.println ("+db");            Branch Statement--IF statement if (true)                        If the middle of the parentheses is correct, then the code inside the curly braces is executed {}//Example                  int age = 13;         if (age <) {System.out.println ("Hello, children)";         } else if (age >= && age <18) {System.out.println ("classmate, hello");         } else {System.out.println ("friend, hello");          }//Branch statement--switch statement int s = 20; Switch (s) {case://case is not supported after decimal input SYSTEM.OUT.PRI                  NTLN ("20s =" +s);                                Break Equivalent to an interrupt case 30://The constant part must be different System.out.println                 ("30s =" +s);                          Break                 Case 40:system.out.println ("40s =" +s);                          Break    Default                            Other conditions System.out.println ("other =" +s);                                       Break                                                   }

  

15.09.29

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.