I just want to Sort an array of Cards by its cardtype "one of four Spade, Heart, Club, Diamond" i.e Spades comes first
I made new array please solve it
private static void colorSort(Card temp[]){
Card arr[];
arr = new Card[13];
int loc=0;
for(Card x: temp){
if(x.cardType=="Spade"){
arr[0] = temp[x]; //this line giving error that "can't convert Card to int"`
loc++;
}
}
}