Not sure if "reference" is the right word. Let me explain.
If I made a method that randomly flips a quarter (heads or tails), then made this
Then I created an object - something like this:
I know I could just say quarter.toss(); and it flips the quarter.
But what if I made an array? OR
How can I reference the number of the array with the toss constructor, like how I did with quarter.toss()? I was trying indexOf but it's not working. I hope that makes sense.
public Coin(){ toss(); }
public static void main (String[] args){ Coin quarter= new Coin(); }
String coinName[] = {"quarter"};
double coin [] = new double [1]; coin [0] = 0.25;