Item code consisting 5 digits is stored in an integer type variable intItemCode. Mr. Srikant wants to store this item code in string variable called strItemCode. Write java statement for this
Answers
Answered by
0
So the data in the question tells us that there is a integer variable called intltemcode and we need to convert it into string type variable.
here's how it's done.
(consider we already have a variable a intltemcode in the memory)
string strltemcode = Integer.parseInt(" "+ intltemcode) ;
we used " " to convert the integer value of intltem code to string value as you may already know that string cannot save integer/ numerical value.
Similar questions