Java notes for busy people--basic programming structure

Source: Internet
Author: User

1. String is a sequence of Unicode encoded points in UTF-16 encoding

2. The scanner of the binding system.in can read the terminal input:

Scanner sc = new Scanner (System. in);

3.java is not a scripting language for quickly completing several commands, it is clearly positioned as a large programming language that can benefit from organized classes and packages.

4. Compile command: Javac Ch01/sec01/helloworld.java

Run command: Java ch01.sec01.HelloWorld

5.Java.lang.System.out Out is a PrintStream instance

6. Random number new random (). Nextint ()

7. Usage rules for basic data types, in large cases, with int

Storage space precious underlying file processing or large array, with byte and short

A big number, more than 2 billion, with a long, if not enough, with BigInteger

8. Binary is prefixed with 0b, octal is prefixed with 0, hexadecimal is prefixed with 0x bit

9.float 6-bit valid decimal place, double 15-bit valid decimal digits

Floating-point numbers are not suitable for financial calculations because there is no precise representation that can be used with the BigDecimal class

10.char describes the encoding unit used by Java in the UTF-16 character encoding, when using 16 binary notation, to prefix the \u, in addition, the char type contains part of the smiley, such as symbols.

Backslash \ Escape single quote and escape backslash

11. The Boolean type is not a numeric type and is not related to integers 0, 1

12. Declaring variables as late as possible is considered a good habit just before the first moment you need a variable.

13. Delay the initialization of the final variable is allowed.

Java notes for busy people--basic programming structure

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.