I have a Method called as getStrategy inside a class and its expecting an array as shown .
public static String getStrategy(Hand[] Hand)
{
}
And this is my Hand Object
public class Hand
{
public char side;
}
On to my client , Please tell me how can i pass this getStrategy method ??
I have tried this
Hand[] HandArray = new Hand[1];
HandArray.side = 's';
MyClassUtil.getStrategy(HandArray);
Please tell me if this si correct or not ??
Well all but the middle line is fine (naming aside). Currently your middle line is trying to access an array as if it were a single object. You probably want something like:
I would also strongly suggest not using public fields…