基本类型传递给重载方法,有个规则:
byte->short->int->long->float->double
short->int->long->float->double
char->int->long->float->double
指的就是byte、char、short等"较小"类型能自动转换成较大的类型作为入参,而不需要额外的其他操作。
基本类型传递给重载方法,有个规则:
byte->short->int->long->float->double
short->int->long->float->double
char->int->long->float->double
指的就是byte、char、short等"较小"类型能自动转换成较大的类型作为入参,而不需要额外的其他操作。