|
-
Method calls with arrays (origionally posted in wrong place)
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
{
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks