Java Learning Lesson 3rd, some small knowledge

Source: Internet
Author: User

There are 3 types of comments in the Java language:

1.//

2./* Note content */

3./** Note content * * This is called a document comment, which is often read as Javadoc document content by the Javadoc document tool

Constants are defined in Java in final, such as: final double pi = 3.1415926;

This value cannot be changed and will be an error if the value is re-assigned below.

Constants are defined in C # with const

In Java, the declaration of local variables, cannot use the public, private, static, protected and other keywords

Common escape characters in Java

\ r Enter, equivalent to return

\ nthe line break

\f Paper Change page

\ t vertical tab, equivalent to the [tab] key

\b Backspace key, equivalent to BACKSPACE

\DDD characters represented by 1 to 3-bit octal data (DDD)

\uxxxx characters (xxxx) represented by 1 to 4 hexadecimal digits

Definition of floating-point type

If the single-precision float FLOAT1 = 1.23f; If you have a decimal, you must follow the F or F suffix

Double-precision doubles are not required when defined

Java Learning Lesson 3rd, some small knowledge

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.