Java中的布尔值和布尔值有什么区别?

2022-01-19 00:00:00 boolean gwt java

我想了解 Java 中 Booleanboolean 类型之间的区别,特别是它们与 GWT 相关的区别.我知道这些方法不受支持,但如果可用,我想了解更多信息.

I would like to understand the difference between the Boolean and boolean types in Java, specifically as they relate to GWT. I know that methods are not supported but I want more info if it is available.

推荐答案

我不确定 GWT 因素是否有影响,但总的来说:

I'm not sure if the GWT factor makes a difference but in general:

boolean 是 java 原始类型,而 Boolean 是包装布尔值的对象/引用类型

boolean is a java primitive type whereas Boolean is an object/reference type that wraps a boolean

像这样在基元和对象之间进行转换称为装箱/拆箱.

Converting between primitives and objects like this is known as boxing/unboxing.

这里有更多信息:

http://javaeye.wordpress.com/2008/06/17/boxing-and-unboxing-conversion/

你为什么问盒子?

http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html

http://www.javapractices.com/topic/TopicAction.do?id=197

相关文章