I have tried to search, maybe I did not locate the right information since I am new to these forums and new to java, but, I have a quick question...
I am working on an inventory program for a school homework assignment.. #5 to be exact, I am sure you guys are aware of them...
I have tried to find out exactly why this works this way but searching the web and other places I still can't put my finger on this simple question..
qty.setText(foo d[recsel].getQuantity()) ;
VS
qty.setText(foo d[recsel].getQuantity() + "");
The first one gives me the invalid type (String vs Int) but the second one works perfect. It does calculations on the field and performs just like an int field.
Is there someplace that someone can point to me that really puts this in easy terms to explain? I understand the theory, being in programming cobol, etc, for a while, but for some reason I just can't get the first one to work right...
I tried using Double, Int, and other forms to set the information returned from getQuantity, but to no avail unless I use + ""
Thanks!
(Hope this posts ok, no clue how to post code yet, so bear with me!)
I am working on an inventory program for a school homework assignment.. #5 to be exact, I am sure you guys are aware of them...
I have tried to find out exactly why this works this way but searching the web and other places I still can't put my finger on this simple question..
qty.setText(foo d[recsel].getQuantity()) ;
VS
qty.setText(foo d[recsel].getQuantity() + "");
The first one gives me the invalid type (String vs Int) but the second one works perfect. It does calculations on the field and performs just like an int field.
Is there someplace that someone can point to me that really puts this in easy terms to explain? I understand the theory, being in programming cobol, etc, for a while, but for some reason I just can't get the first one to work right...
I tried using Double, Int, and other forms to set the information returned from getQuantity, but to no avail unless I use + ""
Thanks!
(Hope this posts ok, no clue how to post code yet, so bear with me!)
Comment