How is it to pass int [] rank
to main method?
public class Card
{
private int [] rank= new int [13];
private String [] suit={"Spades","Hearts","Diamonds","Clubs"};
private static void rankMaker (int []rank)
{
for (int i=1;i<=13;i++)
rank[i]=i;
}
public static void main (String []args)
{
System.out.println("Jack ="+rank[11]);
}
}
Ignoring the way I am making this deck, what I want to know is how generally can I use "int [] rank" (or any other variable declared outside the main) in other methods?