| Author |
Class object for premitive types
|
Hanna Habashy
Ranch Hand
Joined: Aug 20, 2003
Posts: 532
|
|
hi: How can you construct a Class object for a premitive type. for example (int, double, boolean...)
|
SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
|
 |
Nathaniel Stoddard
Ranch Hand
Joined: May 29, 2003
Posts: 1258
|
|
|
The primitives have corresponding wrapper objects (full Objects) in the java.lang package, along with their class objects, of course.
|
Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
|
 |
Hanna Habashy
Ranch Hand
Joined: Aug 20, 2003
Posts: 532
|
|
hi: I want to use Class.getConstructor(Class[] paramType) method of the Class class. consider that I want to retrieve this consructor of the ArrayList class: new ArrayList(int initialValue) I have to supply a Class[] array of the types, in this case it is premitive. how can I construct a Class Object (not a wrraper object) of the premitive int. Using java.lang.Integer doesn't work. any suggestions.
|
 |
Corey McGlone
Ranch Hand
Joined: Dec 20, 2001
Posts: 3271
|
|
Off the top of my head, I believe it is: Let me know if that doesn't work and I'll look into it. Corey
|
SCJP Tipline, etc.
|
 |
Hanna Habashy
Ranch Hand
Joined: Aug 20, 2003
Posts: 532
|
|
Corey : Thank you so much. it works
|
 |
 |
|
|
subject: Class object for premitive types
|
|
|