Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How many types of data transformations are there in Java? When to use each transformation?
How many types of data transformations are there in Java? When to use each transformation?
Automatic conversion and forced conversion in java

Automatic conversions, such as simple type conversions, can be passed automatically.

Such as plastic transform city floating, or double

Some string types are converted into corresponding ascii codes.

However, the conversion will overflow or be lost, and programmers need to force the conversion.

Compared with java, there is data type conversion between original variables and java.

float f = 10.0 1;

Float F = new float (f);

Use each transformation according to your programming needs.