So I am trying to compare the index of the array of strings to a predetermined value so it can return the type of card it will be based on the rank. I know the below method is comparing the actual string to the number I just have no idea how to compare the actual index Value to the number.
public String findFaceValue()
{
String faceValueArray[] = {"Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"
, "Ten", "Jack", "Queen", "King"};
for(int i = 0; i < faceValueArray.length; ++i)
{
if (faceValueArray[i] == rank)
return faceValueArray[i];
}
return "Not a valid card";
}
rank?rankis just any number between 1 and 13 so for example if it's 3 I want the program to return "Three".