Day2 Java Learning Notes

Source: Internet
Author: User
Tags arithmetic operators bitwise operators

1.jdk7 new Features
Use the underscore _ to split the number, you can easily see the number of digits
2. Variables, the essence of which is the most basic storage unit in the program
Type VarName [=value]
3. You can declare multiple variables on a single line, but it is best to
4. Local Variables locally variable
Variables defined inside a method or inside a statement block must be declared and initialized before use
5. Constant final
Can only be initialized once, and is distinguished by uppercase letters, with an underscore to differentiate the word
6. Naming conventions
Variables: First letter lowercase and hump rules, monthsalary, NewAge
Constants: Uppercase letters and underscores
Class Name: initial capitalization and hump rules
7.Java operator
Assignment operator =
Arithmetic operators
+-*%/, two-dollar operator, decimal can also be used to take the remainder
+ +--unary operator
Boolean logical expression, logical AND and or short-circuited, if a value is determined, it is no longer evaluated
&& and
|| Or
! Non -
Bitwise OPERATORS * *
Inverse, bitwise-TO, bitwise, OR, bitwise XOR, left-shift operator, right-shift operator
Extension operators
+ = A+=b a=a+b
-= A-=b A=a-b
8.+ between operands on both sides, as long as one is a string, the entire string is concatenated
9. Ternary operator X? Y:z
The preceding x is a Boolean expression, and if X is true, y is typed, otherwise the Z
10. Operator Precedence
First multiplication and then add and subtract, the expression is preferred to use parentheses to organize
11.eclipse Development environment
12.debug mode
13. Structure
Sequential structure
Select structure
Single selection structure
Dual selection structure
Multi-Select structure If-else if-else
Loop structure
14.switch statements
Equivalent judgment, Switch-case Break-default
15. Enhanced switch: expression result can be a string
16.while do first judgment after execution
Initialization-Conditional judgment-loop body-Iteration
17.do while executing and then judging

Day2 Java Learning Notes

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.