Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting Char to Ints

801513Dec 2 2008 — edited Dec 2 2008
Hi,

I am building an anagram tester. We are not allowed to use any of the Compare classes Java has, soooo I am building a method converting the characters in an array to ints and then comparing them. This is what i have (see below). I get an error of incompatible types when I try to compile and I know I need to move the numeric values into the array to replace the numbers, but I'm not sure how to move them in...I know that it's there somewhere, I'm just not seeing it! I have never used the Character.GetNumericValue before (found it doing research) so I don't know if I am using it correctly.

Any ideas, nudges would be appreciated.

Thanks

Joyce(soon to be a happy welder at this rate)
public static int[] Converter (char[] array)
{
int i;
for (i=0;i<array.length-1;i++)
	{
	Character.getNumericValue(array);

System.out.println(array);
}
return array;
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 30 2008
Added on Dec 2 2008
12 comments
513 views