Java programming Chapter 2 Structured Programming

Source: Internet
Author: User

Outline:

1) identifier and keyword

The identifier identifies the variable name, class name, method name, and file name. It is composed of letters, numbers, underscores (_), and $ characters. The number is not headers, except for keywords and reserved words (false true and null );

Keywords are character sequences with special meanings. Java contains 48 keywords.

2) data types, variables, and direct quantities

Java contains eight basic data types (Boolean byte char int short long float double) and three reference data types (class interface array)

A variable belongs to a certain data type and corresponds to a storage unit. Each variable has a name, type, storage unit, and value.

The direct amount includes the basic data type direct amount, the string (string) and null "/T" and '/T' are different

Data type conversion:

A. Basic Type-> string type, String. valueof (basic type); or use the tostring () method of the basic class packaging class.

B. String-> basic data type. Use the parse *** () method of the packaging class.

Generally, the method of the target type is used to convert data of the source type as a parameter.

3) Operators

The operator acts on one or more parameters and produces new results.

Mainly include Arithmetic Operators, logical operators, Relational operators, value assignment operators, bitwise operators, conditional operators, and other operators.

4) Control Structure

Sequential structure, branch structure (if, if/else, switch), cyclic structure (for, while, do/while), break, and continue

5) function call

Function declaration, function definition, and function calling (parameter transfer); modular design concept andCodeReuse;

5) structuredProgramDesign

Function Structure, top-down, and progressive refinement

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.