I have a function that expects two things:
f (Class type, Object o) { ... }
Now I can pass in a boolean wrapper class like this:
But I can't pass in a boolean primitive:
Why?
I understand that class Class is a subclass of Object right?
So I tried java.lang.Boolean.TYPE to represent the type like this:
f (java.lang.Boolean.TYPE, b); // doesn't work either
But this works:
f (java.lang.Boolean.TYPE, new Boolean(b));
why oh why ?
Is java.lang.Boolean.TYPE = boolean.class ?
Pho
[This message has been edited by Pho Tek (edited April 23, 2001).]
f (Class type, Object o) { ... }
Now I can pass in a boolean wrapper class like this:
But I can't pass in a boolean primitive:
Why?
I understand that class Class is a subclass of Object right?
So I tried java.lang.Boolean.TYPE to represent the type like this:
f (java.lang.Boolean.TYPE, b); // doesn't work either
But this works:
f (java.lang.Boolean.TYPE, new Boolean(b));
why oh why ?
Is java.lang.Boolean.TYPE = boolean.class ?
Pho
[This message has been edited by Pho Tek (edited April 23, 2001).]