| | |
what is the wrong with Byte constructor which takes int value
![]() |
•
•
Join Date: Aug 2007
Posts: 8
Reputation:
Solved Threads: 0
java Syntax (Toggle Plain Text)
class WrapperTest { public static void main(String[] args){ Byte b = new Byte(3); Short s = new Short(34); } }
when I try to compile this is the problem I got
Java Syntax (Toggle Plain Text)
G:\WORK PLACE\work>javac WrapperTest.java WrapperTest.java:4: cannot find symbol symbol : constructor Byte(int) location: class java.lang.Byte Byte b = new Byte(4); ^ WrapperTest.java:5: cannot find symbol symbol : constructor Short(int) location: class java.lang.Short Short s = new Short(34); ^ 2 errors
Please tell me What is the problem of that constructor.
Last edited by WolfPack; Mar 26th, 2008 at 9:32 am. Reason: Added code tags. USe them when you post code.
Probably because there isn't such constructor.
API for Byte object
API for Short object
The values in the parenthesis are not treated as byte and short but as int. I haven't try this and I don't know if it will work so don't blame me, but try:
Byte b = new Byte( (byte)3 );
Short s = new Short( (short)34 );
API for Byte object
API for Short object
The values in the parenthesis are not treated as byte and short but as int. I haven't try this and I don't know if it will work so don't blame me, but try:
Byte b = new Byte( (byte)3 );
Short s = new Short( (short)34 );
Check out my New Bike at my Public Profile at the "About Me" tab
![]() |
Other Threads in the Java Forum
- Previous Thread: Plz gv me a example(sample code) how to connect the database into the JTable
- Next Thread: Swing: default button problem
| Thread Tools | Search this Thread |
6 @param actuate affinetransform android api applet application arc arguments array automation balls binary bluetooth bold business c++ class client code codesnippet color compare component coordinates count database defaultmethod detection doctype dragging ebook eclipse eclipsedevelopment educational error file fractal froglogic game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ideas image ingres intersect invokingapacheantprogrammatically j2me java java.xls javaexcel javaprojects jni jpanel jtextarea julia keytool keyword linux list macintosh method methods mobile mysql netbeans nextline object parameter php pong problem producer program projectideas recursive replaysolutions rim scanner sell server set size sms sql sun swing swt terminal threads tree web websites windows






