Primary knowledge java--(Java Learning note i)

Source: Internet
Author: User

von Neumann ArchitectureJava Core Benefits:Cross-platform---through the JVM (Java Virtual machine) to achieveJvm:java a canonical identifier for a virtual machine: can only be underlined, dollar sign ($), letters, numbers, cannot start with a number float: (occupies 4 bytes of storage) floating-point numbers do not accurately represent all decimals, there is a rounding error double takes up 8 bytes of storage space Char occupies 2 byte int is 4 byte boolean type (one bit is not a byte), one byte occupies 8 bits need to be precise high can use BigDecimal class double and float both cannot represent a numeric value accurately Automatic data type conversions: small-capacity data types can be converted to large data types Why Java can run across platforms:Java is able to run across platforms because he doesn't run directly on any underlying platform, but where it needs to be, and where to prepare his own Java platform beforehand. JVM (Java Virtual machine), which is the Java language runtime Environment Java compiler produces class files for JVM, so the Java interpreter that is independent of the platform is responsible for the Java virtual machine that runs the code of the JVM on a particular platform is not cross-platform. class file---Bytecode file The function of the Main method:
the entry of the program guarantees that the program runs independently of the JVM call

Data type: base data type and reference data type

Basic data types: numeric (integer type (byte, int, long, short) and floating-point type (float, double)), character type (char), Boolean (Boolean) reference data type: class, enumeration, annotation, interface (interface), Array ([]) takes up bytes: Byte (8), short (+), int (+), long (+), float (+), double (64) Small-----> Big Byte,short,char<int<long <float<double integer default: int floating point default: Double type conversion: Automatic type conversion is also called implicit type conversion (up-transition) (small----> Large), coercion type conversion also called explicit type conversion (large------> Small)  ++ at the back of the variable, indicating that the first operation in itself plus 1++ in front of the variable, indicating that the first self plus 1 in the Operation  1.0/0 or 1/0.0 result is infinity (positive infinity) because the value type is promoted to double type The precision of double is higher than int precision  +=,-=,*=,/=,%=: There is an implicit type conversion   XOR (^): The same is false, the difference is true "&" and "&&" The difference: the single and the left and right are both true and false to operate, double and when, if the left is the true right to participate in the operation, if the left is false, then the right does not participate in the operation "|" The "| |" The difference is the same: double or when the left is true right does not participate in the operation "^" and "|" When the difference is true, the "^" result is false  short-circuit with (&&): When the operation on the left side of && is false, the operation on the right side of the judgment is not shorted or (| | ): When | | When the left operation is true, it is not judged | | Operation on the right.    ternary operator:  boolean expression? Statement 1: Statement 2  executes statement 1 When Boolean is true, executes statement 2  shift:  Left (>>) and right (<<) when the Boolean expression is False Move left (move right): The binary code overall left to move the specified number of digits, left after the empty use ' sign bit ' to Supplement 1) if positive, the use of 2) if negative, then use the one complement   unsigned right shift (>>>), the binary code to move the whole right to the specified number of digits, One to the right is divided by 2, and the null after the right shift uses ' 0 ' to replenish   loopThe control:  controls the outer loop, you can terminate the outer loop with the label (Outer:for () {} break outer;): The label of the break outer loop jumps out of the outer loop: the label of the outer loop of the continue return: the way to end the loop The  break,return,continue statement cannot be followed by a statement  system.out.print () can be passed without reference to the parameter System.out.print () must be

Beginner java--(Java Learning note 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.