2016.1.14-2016.1.15 Study Summary

Source: Internet
Author: User

What's the data type?

1, data type is easy to read with human tags, used to indicate the specific use of computer memory;

2. When used in a program, the data type specifies the size of the memory used and the valid values that can be stored in that memory.

3. Java is a strongly typed programming language, which means that all variables used in Java programs must have well-defined data types.

How is the Java data type divided? What types are included? What is the size of each type?

Base type (int: byte 1 bytes short 2 bytes int 4 bytes Long 8 bytes Float type: Float 4 bytes Double 8 byte char char 2 byte bool Boolean indeterminate);

Reference type (class: Class Interface interface string: string)

How do I declare the creation of a variable? What to pay attention to?

Each variable in a Java program belongs to a specific data type, which must be declared before use, in the form of a data type variable name, variable value;

The syntax for initializing a variable after declaring it: The data type variable name = initial value (such as int i = 0;).

What's the constant? What do constants need to be aware of?

The amount that cannot be changed during the run is constant, and note that the character constants and string constants are distinguished. The Java floating-point constant defaults to double, and if you want to declare a constant of type float, you need to add F or F after the number.

How do I declare constants and what do I need to notice?

The syntax for declaring a constant is as follows: Final data type variable name = constant value; Note: The symbolic constants must be assigned when they are declared, and cannot be changed throughout the program to be re-assigned.

What is an identifier? What are the two types of identifiers?

An identifier is a variety of character sequence symbols in a computer language that represents a particular meaning. Divided into: User customization and System customization.

What are the naming rules for Java identifiers?

Identifiers consist of a letter, an underscore "_", a dollar symbol "$", or a number.

Identifiers should begin with a letter, underscore, and dollar symbol.

Java identifiers are case sensitive and have unlimited length.

"See the name and know It"

cannot be a keyword

Insisting on the hump naming method

What are keywords and what are the characteristics?

Some of the specific meanings that are assigned to Java are referred to as keywords for specialized purposes. Keywords feature: Most editors mark keywords in a special way. All Java keywords are in lowercase english.

What rules do I need to follow for data type conversions?

Small turn large automatic turn, big turn small need to cast, but note: 1, plus the forced conversion, but may result in reduced precision or overflow; pay extra attention when using. 2. The Boolean type cannot be converted to another data type. 3, floating-point constants (such as: 1.2) default to Double. To declare a constant of type float, you need to add F or F after the number. 4, integer constants (such as: 123) default to int. Declares that a long constant can be followed by an ' l ' or ' l '.

What is the function of the operator? What are the different categories?

Operator is used to concatenate operands, literals, or variables involved in an operation.

The Java language supports the following operators: Arithmetic operators: +,-, *,/,%,++,--

Relational operators: >,<,>=,<=,==,!=

Logical operators:!,&&,| |

Bitwise operator:&,|,^,~,>>,<<,>>>

Assignment operator: =

Extended assignment Operator: +=,-=,*=,/=

String Join operator: +

Conditional trinocular operation symbol:?:

What is the function of the assignment operator? What to pay attention to?

The function of the assignment operator is to assign a data to a variable.

Note: 1, the left side of the assignment symbol is only one variable, 2, the integer constant can be assigned directly to the type variable Byte,short,char, but does not require coercion type conversion, as long as it does not exceed its table number range.

What is an arithmetic operator? What operators are included in the arithmetic operator?

Arithmetic operators refer to the standard mathematical operators we have learned in primary school.

Arithmetic operators include: + addition operator,-subtraction operator, * multiplication operator,/division operator,% modulo operator, + + increment operator,--decrement operator.

What is the modulo operator?

The modulo operator is the remainder of the operation.

What is the increment and decrement operator? What should I pay attention to?

The increment and decrement operators indicate that a value is incremented by 1 or decremented by 1. The increment operator is represented by a two plus sign (+ +). The decrement operator is represented by a two minus sign (--).

Note: There is no * * and//, the symbol before the first count, the symbol after the first use after the calculation.

What's the relational operator? What does the relational operator include?

Relational operators are relatively simple in logical operations. The so-called "relational operations" are actually "comparison operations".

Relational operators include:> greater than < less than = = equals >= greater than or equal to <= less than or equals! = is not equal.

What is the function of logical operators?

Logical operators can make multiple comparisons and combine the results into a single Boolean value.

What are bitwise operators and what are bitwise operators?

When working with integer data, you can directly manipulate the individual bits that make up an integral type value.

For operators include: short-circuit (&& | | | Bit or) does not short circuit (& bit with | bit or) ^ bit XOR (the same as 0 in binary is different from 1) ~ Bit non (inverse number minus 1)

What does the shift operator have, and what does it mean?

<< left shifts a value to the power of 2 by moving it to the left

>> move right shifts one value to the right by dividing the value by a power of 2

>>> Right Shift 0 to the right shift supplement, the symbol bit to the right, empty 0

Extending an assignment expression why?

+ =: a+=b a=a+b

What should I pay attention to when using character to connector?

"+" can also be used to concatenate strings in addition to arithmetic addition operations.

As long as there is a string type in the operands on either side of the "+" operator, the system automatically converts the other operand to a string and then connects.

When printing, no matter the type, it is automatically converted to a string for printing.

What are the three-mesh conditional operators? What's the meaning?

The Trinocular condition operator is a? B:c meaning A is true then execute B and A is false to execute C.

What is an expression?

An expression expression is a combination of operators and operands (recall that the operand is an object of operator manipulation). The simplest expression is a single operand, which can be used as the basis for building complex expressions.

Example: 4 constant expression

A-variable expression

5.0+a Arithmetic expressions

(A-B) *c-4 arithmetic expression

A < b boolean expressions

i<30 && i%10!=0 Logical Expressions

What are the types and values of an expression? Is the expression in the order of operation?

The value of an expression evaluates to an operand in an expression that results in a value called an expression. Emphasis: An assignment expression also has a value, which is the value of the expression on the right of the assignment number.

The type of the expression is the type of the expression value that is the data type of the expression.

The type of operation of an expression is in the order of precedence of the operator from highest to lowest. Operators with the same precedence are performed in a pre-agreed binding direction.

What is a statement? What do you need to pay attention to?

A statement is a basic component of a constructor program. A program is a collection of statements with some kind of required punctuation. A statement is a complete computer instruction.

When writing your code, be aware that you must add the ";" sign to the end of the statement.

What's the standard input? How do I make standard input?

Use system.in technology to enter data in the form of "standard input".

You can enter system.in directly into a single byte. In order to enter the basic data type, we need to use the scanner class

                         ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                          ,         &NB Sp                                                            ,         &N Bsp                          ,         &NB Sp                              

2016.1.14-2016.1.15 Study Summary

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.