Java Learning notes Finishing chapter I Java basic data types, modifiers, operators

Source: Internet
Author: User
Tags bitwise operators logical operators modifiers java keywords

Java keywords:

Java Keywords are pre-defined in a computer language, with special identifiers, sometimes called reserved words, and variables of special significance.   Java's keywords have special meanings for Java compilers, they are used to represent a data type, or to represent the structure of a program, and the keyword cannot be used as a variable name, method name, class name, package name, or parameter. The specific Baidu encyclopedia ' Java keyword '.

Java identifiers:

In the Java language, there are names for variables, constants, functions, and statement blocks, all of which we call Java identifiers. Identifiers are used to name classes, objects, methods, variables, interfaces, and custom data types. Note: A, the number can not start B, the keyword can not be used. C, PackageName, we're all letters.lowercase,className we areCapitalize first letter,variablesNameFirst Letter lowercase first letter uppercase. D, constant name: All letters are larger, and there are no words with an underscore when multiple words are connected. Note: Single line comment://comment One line multiline comment/* Comment content * * Note: The content of the comment will not be compiled, just explain the description block comment/**..........*/Document comment change (values that can be changed) and constants (values that cannot be changed); Array of operator statements binary, decimal, hexadecimal; conversion between binary () Eight basic data TypesNumeric: Integer: Byte, short, int (most commonly used), long (for larger data); Floating point (decimal): Float (single precision-) write the data to be followed by F, otherwise the system defaults to double type, Doubie (double) system default Type Note: Foat represents the decimal point Fewer digits, double can represent a number of decimal places, more accurate! Float is a single precision, with 4 bytes in memory and 8 bits in the active digits. Double doubles for 8 bytes, and the valid digits are 16 bits. Character type: char example:char c1 = ' A ',char c2 = ' you '; Boolean Type: BooleanThe Boolean data type represents one bit of information; only two values:true and false; This type is only used as a flag to record true/false;The default value is false; Example: Boolean B = flase. Reference Data Type classes (Class): interface (interface): array:Operator Classification: Arithmetic class: Monocular: + (Take positive)-(minus) + + (self-increment)--(self-subtraction) Binocular: +-*/% (take-over) three mesh: A>b?true:false Description: When a is greater than B, true (that is, the value before the colon), otherwise false This entire operator includes a relational operator (can be ">" "<" "! =" and so on), one "? ", a": ", you need to have two expressions or a value or an object before and after a colon. Relationship equals symbol: = =, not equal to symbol:! =, greater than symbol:;, less than symbol: &LT;, greater than equals symbol: >=, less than equals symbol: <=. Bitwise operators with (&), non (~), or (|), XOR (^) logical operators with (&&), non (!), or (| | | )

Java Learning notes Finishing chapter I Java basic data types, modifiers, operators

Related Article

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.