Hi,
I think that the problem is about "cast"
//evaluates '1'-'0' to what? How do you subtract literals?
intEq[i] = currChar - '0';
char has been cast to int implicitly when you do the '-' job.
Hugs,
Eric Cai
On Fri, Jul 31, 2009 at 6:30 AM, JKid314159 <[email protected]> wrote:
> Dear Java Programmer:
>
> Here hex is a string. A 10 is entered into the JOption pane. This is
> recognized as a character of '1' and '0'.
>
> //This comes into this method and the length of 2 makes
> //a one dimensional array of 2 with the values [0],[1].
> int intEq[] = new int[hex.length()];
> //hex.length = 2
> for (int i = 0; i < hex.length(); i++) {
> //first character is '1'
> currChar = hex.charAt(i);
> if (currChar >= '0' && currChar <='9') {
> //evaluates '1'-'0' to what? How do you subtract literals?
> intEq[i] = currChar - '0';
>
>
> Respects,
>
> *JKid314159*
> http://existentialists.blogspot.com/
> <http://groups.google.com/group/existentialist-reading-circle?hl=en>
>
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---