Java Learning---2.java basics

Source: Internet
Author: User

1, a variable is a small area in memory that uses the variable name to access the area.

2. Local variables are set to the initial value, first declared in the assignment

3. Process of program execution:

3. Type conversion: The small size of the type automatically converted to a large capacity data type, byte short char does not convert to each other, the calculation is first converted to int type, large conversion to small to strengthen the conversion

byte b3= (Byte) (B1+B2)

Double d2=1e200;

float f2= (float) d2;//will generate overflow

Float f3=1.23f;//must add f

Long l2=300000000l;//must add L, otherwise the compiler thinks it is int, must add l

Java Learning---2.java basics

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.