JAVASE basic knowledge Note 3

Source: Internet
Author: User

Java se v:
1. Relational operators: greater than (>), less than (<), equal to (=), not equal (! =), Greater than or equal to (> =), less than, etc.
In (<=), the result of the relational operation is a boolean value.
2. logical operators: two operators are explained in detail. The logical operators themselves return a boolean value.
1) logic and: Use & to indicate that the logic is a binary operator (that is, an operator with two operands), only
When both operands are true, the result is true. Otherwise, the result is false. Sum of logic and representation
And.
2) logic or: Use |, indicating that the logic or binary operator is false only when both operands are false,
The result is false. In other cases, the result is true. Logical or representation or meaning.
3. Short Circuit features of logical operators.
1) logic and: if the first operand is false, the result must be false. In this case,
The logic and subsequent operations will not be executed, that is, a short circuit occurs.
2) logic or: if the first operand is true, the result must be true. In this case,
The logic or subsequent operations are not executed, that is, a short circuit occurs.
4. Auto-increment and auto-increment operations on variables.
1) For int B = a ++, the function is to assign the value of a to B first, and then let a increase by 1.
2) For int B = ++ a, the function is to first increase the value of a by 1, and then assign the result of auto-increment to B.
 
Java SE 8
1. break statement: It is often used in loop statements to jump out of the entire loop and run the code after the loop.
2. continue statement: It is often used in loop statements to jump out of the current loop (or jump out of this loop ),
Start the execution of the next loop.
3. break and continue can be used together with tags. In actual development, no one will use break and continue.
Use with tags.
4. Object-Oriented Programming (Object Oriented Programming, OOP; Object Oriented Design, OOD ).
What Is Object-Oriented? There are two important concepts in Object-Oriented Programming: class and object ).
5. Class: class is an abstract concept. It contains data (usually expressed by nouns) and data manipulation (
). For example, a person is an abstract concept. A person has data such as name, age, and height,
There are also data manipulation activities such as eating and running.
6. Object: an object is a specific concept and a specific expression of a class. For example, a person is a class,
Li Si, Wang Wu and others are specific objects.
7. The content of the class. The class consists of two parts:
A) data. Data is called a Property or Attribute in a class or a Member variable (Member ).
Variable ).
B) data manipulation. Such manipulation is called a method in a class ).

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.