什么是自动装箱和胁迫之间的区别? [英] What is the difference between autoboxing and coercion?

查看:182
本文介绍了什么是自动装箱和胁迫之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Java,C和我的Python程序。

I program in Java, C and Python.

算术类型之间自动的强制规则已经
  增强处理更丰富的类型

The rule for automatic coercions among arithmetic types have been augmented to handle the richer set of types

来源:C程序设计语言

但什么是胁迫是什么意思?这些问题的答案说,这就像类型转换和隐式转换和隐式类型转换,并呼吁自动装箱,我读它。所以automboxing和胁迫之间的区别是什么呢?

But what does "coercion" mean? The answers say it's like type conversion and implicit casts and implicit type conversions and called autoboxing where I read it. So what is the difference between automboxing and coercion?

感谢

推荐答案

强制是一个的的类型转换,即,一个由语言规则的规定,由程序员没有明确增加了另一个名字。

Coercion is another name for an implicit type cast, i.e. one mandated by the language rules, and not explicitly added by the programmer.

这篇关于什么是自动装箱和胁迫之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆