![]() |
Compiler error...why?
Byte b=new Byte(1); //<-here
|
The constructor for a Byte does not take an integer value but a String value instead. See below.
:
Byte b = new Byte("1"); |
Actually there are two constructors:
:
1. Byte(byte value) Example of each: :
public class ByteTest {So to answer your question, you could create a Byte from an integer with a simple cast like so: :
Byte b = new Byte( (byte)1 ) ); |
| All times are GMT -5. The time now is 1:52 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC