September first week learning experience

This week the major review study past knowledge, knocked seven hours code,

1. Review of the variables used in steps

2. Constants: final <data type> <constant name> = <Initial value> = 3.149 Final Double the PI
! ~ Unary comprising ++ - High priority

3. ternary operator: ternary operator int min; min = 5 <7 5:? 7;  

4.while (): Features: first judgment, then execute do while (): Features: first performed, and then determination.

5.final usage 1. The final modified class can not be inherited 2. the final modification methods can not be overridden by final 3. modified variables can not be changed. If the modification referenced, represents a non-variable references, citations point to a variable.

6.

And the difference between == equals () of

== operator is used to compare two variables are equal, and the equals method of Object class, comparing whether two objects are equal. equals method of Object class default address compare two objects, at this time, and the results of the same ==. In other words: basic types == comparison, the comparison of their value. By default, when the object == comparison, the comparison is a memory address, if you require a target content needs to be rewritten equal method.

Guess you like

Origin www.cnblogs.com/sunhongbin/p/11441395.html