????????
????Java????????????????4??
????1. Instance Variables: (Non-Static Fields) ???????????field
????2. Class Variables: (Static Fields) ???????field
????3. Local Variables: ???????
????4. Parameters: ????
?????????????????????field??variable??field????????1??2????class??е????????field???????variable??????????3??4???????????????variable??
????????
????Java??????????д???????????????????????java??????????????????????????????????????????????????????????????????д?????磺 speed?? currentGear
???????????????? Primitive Data Type
????Java??8??????????????
?????????? 4???? byte?? short?? int?? long
???????? 2???? float?? double
??????? 1???? char
???????? 1???? boolean
??????????????????£?

???????? Default Value
??????????г??????????????????c/c++????????????????java???????????????????????
????The eight primitive data types are: byte?? short?? int?? long?? float?? double?? boolean?? and char. The java.lang.String class represents character strings. The compiler will assign a reasonable default value for fields of the above types; for local variables?? a default value is never assigned. A literal is the source code representation of a fixed value. An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation?? its length is fixed.
?????????Field?????????????????????int???0??object???null????????Variable??????????????????????г????????????????