Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert object to char primitive

 
Deepa Krishnan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a object which contains a char primitive from the request,
I need to convert that object to char.

thanks in advance
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of Object is it? Is it an instance of the Character wrapper class? If so, you can call the charValue() method to get a char primitive. If not, you need to provide some more detail. For instance, what request are you talking about? If possible, you should post some code to illustrate what you are trying to do.

Layne
 
Deepa Krishnan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
charValue() is the answer
thanks layne
[ August 02, 2005: Message edited by: Deepa Krishnan ]
 
Deepa Krishnan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
layne,

still showing error!!

I am sending like this from jsp
<input name="SUBPROGRAM_CD" type="hidden" value=''>
Ejb receiving it like this
char subprogCode

subprogCode=((Character)request.get("SUBPROGRAM_CD")).charValue();
[ August 02, 2005: Message edited by: Deepa Krishnan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic