convert primitive int to Object

Hi All,

I have to convert primitive int to Object.

How it is possible.

Please reply soon

I am getting error while executing following code..

.

request.setAttribute("fabricatorid",fabricatorid);

request.setAttribute("bannerid",bannerid);

.

as fabricatorid is int and it required Object.

Thanks

[409 byte] By [harishpathaka] at [2007-10-2 22:12:19]
# 1
int i = 12;Integer a = new Integer(i);Object o = (object)i;
samue-1a at 2007-7-14 1:29:13 > top of Java-index,Java Essentials,Java Programming...
# 2
int i = 12;Integer a = new Integer(i);Object o = (object)a;
samue-1a at 2007-7-14 1:29:13 > top of Java-index,Java Essentials,Java Programming...
# 3
Sorry for the wrong posts , I am too tired now sorry agin.The correct one :int i = 12;Integer a = new Integer(i);Object o = (Object)a;
samue-1a at 2007-7-14 1:29:13 > top of Java-index,Java Essentials,Java Programming...
# 4
In Java 5 you can writeObject o = 12;
Peter__Lawreya at 2007-7-14 1:29:13 > top of Java-index,Java Essentials,Java Programming...
# 5
Yeah, it is correct.Infact, all primitive variables are derived from their wrapper classes but they have the ability tobe changed and to be assigned to any value of their own types, am I correct ?So the following can be applied in Java or C# :Object o = 12;
samue-1a at 2007-7-14 1:29:13 > top of Java-index,Java Essentials,Java Programming...