Android & amp; the second day of Java learning, official website of android

Source: Internet
Author: User

The second day of Android & Java learning, official android website

Learned the basic types of data

Procedure

Step 1: declare a Variable Step 2: assign a value Step 3: Use a variable

Scope and lifetime of Variables

A variable can declare a block in a code block starting with the left braces and ending with the right braces to define the scope. Each time a new block is created, A new scope variable will be created. The scope of each variable has its own scope. the lifetime of the variable refers to the life cycle of the variable.

Data Conversion Type

Automatic type conversion

When a type of variable is assigned to another type of variable, automatic type conversion occurs if the following conditions are met: two types are compatible; the target type is greater than the source type;

Forced type conversion

Forced conversion is used for explicit type conversion. If the data type of the converted value is greater than the target type, some information is lost.

 

 

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.