java类型,不是类型原语

时间:2022-03-24 16:27:39

I'm familiar with the java primitive types which is described in the following link http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html but my question is to which type the following types is related

我熟悉java原语类型,它在以下链接http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html中描述,但我的问题是以下类型与哪种类型相关

BigDecimal ,
java.util.Date
String 

....

where can i found doc that describe the type which are not primitive and are not related to list hashMap etc I talking about types that can be defined as class members.

我在哪里可以找到描述非原始类型并且与列表hashMap等无关的类型的doc我在谈论可以定义为类成员的类型。

2 个解决方案

#1


2  

you can find those information in java api. for example, BigDecimal:

你可以在java api中找到这些信息。例如,BigDecimal:

http://docs.oracle.com/javase/6/docs/api/java/math/BigDecimal.html

Any type can be defined as type of a class member.

任何类型都可以定义为类成员的类型。

#2


1  

which type the following types is related

哪种类型与以下类型相关

If understand this as the "relationship" between int and Integer for example, then the classes you mentioned do not have any "related" primitive type.

如果将此理解为int和Integer之间的“关系”,那么您提到的类没有任何“相关”基元类型。

But as mentioned previously, any class can be a class member.

但如前所述,任何类都可以成为类成员。

A list of the correspondence among primitive types and their wrapper classes can be found here

可以在此处找到基本类型及其包装类之间的对应关系列表

Primitive type  Wrapper class

boolean         Boolean
byte            Byte
char            Character
float           Float
int             Integer
long            Long
short           Short

#1


2  

you can find those information in java api. for example, BigDecimal:

你可以在java api中找到这些信息。例如,BigDecimal:

http://docs.oracle.com/javase/6/docs/api/java/math/BigDecimal.html

Any type can be defined as type of a class member.

任何类型都可以定义为类成员的类型。

#2


1  

which type the following types is related

哪种类型与以下类型相关

If understand this as the "relationship" between int and Integer for example, then the classes you mentioned do not have any "related" primitive type.

如果将此理解为int和Integer之间的“关系”,那么您提到的类没有任何“相关”基元类型。

But as mentioned previously, any class can be a class member.

但如前所述,任何类都可以成为类成员。

A list of the correspondence among primitive types and their wrapper classes can be found here

可以在此处找到基本类型及其包装类之间的对应关系列表

Primitive type  Wrapper class

boolean         Boolean
byte            Byte
char            Character
float           Float
int             Integer
long            Long
short           Short