Thanks for the solution.I am sorry i did not reply immd as i was out of my office and 
did
not notice the reply.
usha.

Joe Sam Shirah wrote:

>     Hi Usha,
>
>     You can do this directly, letting the compiler do the conversion, as
>
> Integer.toHexString(byteVal);  // bytes are signed, max val = 127
>
> Integer.toHexString(charVal)
>
>     See attached program.
>
>                                                             Joe Sam
>
> Joe Sam Shirah
> Autumn Software
> Consulting/Development Services when YOU need them
> ___________________________________________
>
> -----Original Message-----
> From: X. Amala Sahaya Babu <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Friday, December 31, 1999 1:29 AM
> Subject: Re: Conversion to Hexadecimal
>
> >I don't know whether it's an optimised solution.
> >
> >1. Using String(Char[] value) to convert char into String object.
> >2. Then Convert String Object to Long or Integer Object by using
> >    Long or Integer Wrapper Class. e.g. Integer.valueOf(String str).
> >3. Then using Integer.toHexString(int num) convert that into Hexadecimal.
> >    num = Integer.intValue();
> >
> >    The same way you can use Long also.
> >
> >Cheers
> >
> >Babu
> >
> >----- Original Message -----
> >From: Usha Sree Y <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Wednesday, December 29, 1999 11:13 AM
> >Subject: Conversion to Hexadecimal
> >
> >
> >could someone tell me how to convert a char or byte to a hexadecimal
> >value in Java.
> >i am sorry if this is off-topic.
> >I have gone through the documentation and found some example but could
> >not  understand it.
> >
>
>   ------------------------------------------------------------------------
>                     Name: HexToInt.java
>    HexToInt.java    Type: JAVA File 
>(application/x-unknown-content-type-java_auto_file)
>                 Encoding: 7bit

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to