|
-
November 16th, 2011, 12:51 PM
#1
Conversions
I am currently crearting a program with a lot of conversions IE:
Code:
client c = (client);
String[] X = getIntegerValuesOf(x);
String[] Y = getIntegerValuesOf(y);
String[] objectID = getIntegerValuesOf(objID);
String[] objOrientation = getIntegerValuesOf(orientation);
String aX = String.valueOf(X);
String aY = String.valueOf(Y);
String iD = String.valueOf(objectID);
String objO = String.valueOf(objOrientation);
int absX = Integer.valueOf(aX).intValue();
int absY = Integer.valueOf(aY).intValue();
int obJOrientation = Integer.valueOf(objO).intValue();
int obJID = Integer.valueOf(iD).intValue();
I am fully aware that a string literal "1" is equal to 49 or something in terms of integers. But, if I assinged the value of the string to whatever an integer 1 is, then when I bring it back to an integer it sould remain a 1 correct?
-
November 17th, 2011, 08:51 AM
#2
Re: Conversions
I am fully aware that a string literal "1" is equal to 49 or something in terms of integers.
The string literal '1' as an ASCII character has the decimal value of 49 but if you convert '1' to an int using Integer.valueOf(aX).intValue() or Integer.parseInt(aX) you get the int value of 1.
But, if I assinged the value of the string to whatever an integer 1 is, then when I bring it back to an integer it sould remain a 1 correct?
I don't know what you mean by this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|