sry i had origionally posted this in the java developers section of the forum
alright i was wondineg if it is possible to call methods with an array
here is why i need this to happen:
i am calling a series of methods that all have the same return time (boolean)
and once the return from one of these method becomes true i need to stop and return that
a "driver" is calling all of these methods
(it's a poker game)
it first calls isRoyalFlush....then all the way down to isHighCard
i realize that they dont' truly have to be seperate methods, but for testing/creating it would be much easier. once they return a true value, i want the search to break and return
could anyboyd tell me how to, or an alternate way to doing this?
if that makes no sense:
public void Play()
{
Method[]arr=new Method[/*not sure what goes here*/]; /*maybe like the method names, i'm thinking of somethign like an onClick in javascript for buttons where i would do onClick="isRoyalFlush()"*/
boolean isType=false;
for(int i=0;i<9;i++)
{
isType=arr[i];
if(isType)
//print and do all that stuff
}
}
public boolean isRoyalFlush()//this would be cell 0 in the array
{
}
public boolean isStraightFlush()//cell 1....etc
{
}


Reply With Quote


Bookmarks