13-from scratch to JavaWeb-complete interpretation of member variables and local variables, 13-javaweb-

Source: Internet
Author: User
Tags variable scope

13-from scratch to JavaWeb-complete interpretation of member variables and local variables, 13-javaweb-

Tutorial video:

1. Variable Division

2. member variables and local variables

3. Scope and lifecycle of Variables

I. variable definition

Data type variable name = value;

Ii. Variable Classification

Variables can be divided into two types based on their defined locations:

1. member variables: variables directly defined in the class

2. Local variables: variables defined in methods or code blocks

 

Iii. Variable Initialization

Variables are initialized to open up space in the memory.

One member variable has a default value and the other has no default value.

Member variables can be used directly.

If you do not set an initial value for a local variable, an error is reported if you use it directly.

Iv. variable scope

The range that can be used after the variables are defined

V. Variable Lifecycle

Vi. Notes on variables

 

 

Follow the following code: "Xiaoqiang code"

Get the latest update video and

"Code + software + Xmind notes" in the "Code ant Java learning communication group: 625973026" File Sharing

 Netease cloud: ClickIt is recommended to watch online at a high speed.

 

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.