Thread View: borland.public.jbuilder.java.api
4 messages
4 total messages
Started by andy
Tue, 22 Oct 2002 10:50
How to convert Integer into byte
Author: andy
Date: Tue, 22 Oct 2002 10:50
Date: Tue, 22 Oct 2002 10:50
7 lines
1081 bytes
1081 bytes
hai, Can I Convert Integer into byte ?, Can you give an example ? TIA, andy
Re: How to convert Integer into byte
Author: Gillmer J. Derge [TeamB]
Date: Tue, 22 Oct 2002 14:24
Date: Tue, 22 Oct 2002 14:24
11 lines
1315 bytes
1315 bytes
"andy" <andy@cpssoft.com> wrote in message
news:3db52e09@newsgroups.borland.com...
> Can I Convert Integer into byte ?, Can you give an example ?
You mean like this?
Integer i = new Integer(12);
byte b = i.byteValue();
--
Gillmer J. Derge [TeamB]
Re: How to convert Integer into byte
Author: Ken Sprague
Date: Tue, 29 Oct 2002 07:27
Date: Tue, 29 Oct 2002 07:27
8 lines
1141 bytes
1141 bytes
Easiest way is just to do a typecast:
int i = ...;
byte b = (byte)i;
This will put the low eight bits of the int in the byte.
Ken
Re: How to convert Integer into byte
Author: Ken Sprague
Date: Tue, 29 Oct 2002 07:31
Date: Tue, 29 Oct 2002 07:31
4 lines
1076 bytes
1076 bytes
Sorry, asleep at the wheel. I see Andy was asking about Integer -> byte, not int -> byte. Ken
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads