Lesson Two: Java basic syntax

Source: Internet
Author: User

Each programming language has its own unique grammatical rules, but as the C language of "the father of modern programming languages", many things in C are similar to other programming languages.

Each language has its own identifier, and the identifier of a language is not many, but each has its own role.

Data, each language is data. So the data type is a very basic thing, in Java the data type is only 11, which includes eight basic types and three reference types. Of the eight basic data types, except for the integer, floating-point, and character types that exist in the C language, the Java language has a Boolean type that only has a true/False Boolean.

Variables: variables are indispensable for each programming language, stored value, value. are inseparable from variables, and Java's naming rules are very simple, you cannot start with a number, you cannot use a reserved word in the Java language, a keyword, you cannot start with any symbol other than $ and underscore.

Constants: Constants are fixed values in a programming language, and constants are not changed from the moment they are defined. The keyword that defines a constant is final, and the name of the defined constant must also be capitalized in all English.

Operations are indispensable to every programming language, and operators are the way we use operations in writing, knowing that the meaning of each operator is the premise of using operators. In addition to the already familiar operators in C, in Java, there are several additional operators, such as: Shift operators,>>,<<,>>>; short-circuiting and &&, short-circuiting or | | ; comparison operator: instanceof;

Lesson Two: Java basic syntax

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.