首页 > 文档 > int()整数转换
2017
07-20

int()整数转换

Name

int()整数转换

   

Examples

float f = 65.0;

int i = int(f);

println(f + ” : ” + i); // Prints “65.0 : 65”

 

char c = ‘E’;

i = int(c);

println(c + ” : ” + i); // Prints “E : 69”

Description

Converts any value of a primitive data type (booleanbytecharcolorfloatint, or long) to its integer representation.

When an array of values is passed in, then an int array of the same length is returned.

将基元数据类型的任何值 (布尔、字节、char、颜色、浮点、int long) 转换为其整数表示形式。

 

在传入值数组时, 返回相同长度的 int 数组。



最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。