Java Learning Notes (i)

Source: Internet
Author: User

1. Java is case-sensitive.

2. The Java class naming rules are camel-named (that is, the first letter of each word is capitalized).

3, Java has 8 basic data types: 4 kinds of shaping, 2 kinds of floating-point, 1 kinds of char, 1 kinds of Boolean (Java does not have unsigned type, floating-point type generally uses double type, in programming generally do not use char type).

4. The declaration of a variable in Java is as close as possible to the place where the variable was first used.

5. The final keyword indicates that the variable can only be assigned once. Eg:final type var

6, the name of the constant is generally used in all uppercase, and the variable is generally used in the first letter lowercase word capitalization.

7, class constant: Indicates that the constant can be called in each method in the class. Eg:static final type var.

8, Java support ternary operator operation

9. The >>> operator uses a high-level zero-fill method, and the >> operator uses the symbol bit padding.

10. The right parameter of shift operation in Java requires modulo 32 operation.

11. Use the Math.Round () method to get the rounding of a number, which is the integer nearest to the number.

12. There is no string type in Java, but a string class is predefined, and all strings enclosed in double quotation marks are of type string.

String class common methods for strings

1, the method of obtaining a substring in a larger class: substring ();

2. Use the plus sign to complete the concatenation of a string.

3. Check that two strings are equal to the Equals () method.

Java Learning Notes (i)

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.