1。
Floating point number a = 3.14;
System.out.println ("integer part:"+(int) a);
System.out.println ("fractional part:" +a% 1)
2。 Converts a floating-point number to a string, and then uses the. The first part is an integer and the second part is a decimal.