1. Beginner Java

Source: Internet
Author: User

The content behind the 1.public class must be the same as the source file name;

2.java language case sensitive (for example, void is a keyword and void is not);

3. Identifiers: Can consist of letters, numbers, underscores (_), and dollar signs ($) (but cannot start with a number), and cannot contain other special characters such as spaces;

4. Describe the three elements of a variable: variable type, variable name, variable value;

5. Define a variable of string type: string words = "I love u";

Concatenation of strings and variables with +: SYSTEM.OUT.PRINTLN ("The content of the variable is:" +words);

6.java variable name No length limit, composed of more than one word, the first letter is lowercase, the rest of the word capitalized, such as numofstudents (hump naming law);

7.java Data type:

String type with double quotation marks;

8. It is not recommended to name variable names in Chinese, so it is easy to generate garbled characters;

9. Automatic type conversion in Java: Condition 1. The target type is compatible with the original type, such as double and int compatible, and int and char are incompatible; the target type is greater than the original type, for example the double type is 8 bytes, the int is 4 bytes, so the int type can be converted to double type;

Forced type conversions in 10.java:

Operation Result: 75.8

75

Because it is not rounding but directly to the fractional part, so it is easy to cause data loss.

1. Beginner Java

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.