Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What is the data type of long in JAVA?
What is the data type of long in JAVA?
The difference between Long and long can be distinguished from the following points:

The definitions of the two are different. Lowercase Long refers to the basic type, and uppercase long refers to the object type, also known as the wrapper class.

Although both of them belong to a data type of Java, the basic data type long cannot be a new object. In order to make up for the defects of Java, the object data type Long wrapper class appears, which can be said to be a great supplement to the basic types.

Lowercase Long has a default value (), and object is generally null by default, so some methods in uppercase long are just to meet the needs of lowercase long.

The way to distinguish the two is:

Keep in mind the definitions of the two and distinguish them by definition;

Use these two data types extensively and master them skillfully in practice;

Participate in project actual combat, accumulate actual combat project experience, and distinguish the two.

Note: When using these two data types, you will use general classes, so you must master some rules of general classes:

Generic parameter types can also be wildcard types;

The same generic can correspond to multiple versions, but different versions of generic classes are incompatible.