Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Parsing array

Posted on 2004-04-13
6
Medium Priority
?
204 Views
Last Modified: 2012-05-04
I want to parse two arrays to a constructor of a class. why aint it working?

int bPos[] = new int[2];
int pPos[] = new int[2];
GameTreeNode root = new GameTreeNode(pPos[0], pPos[0]);

with:

public GameTreeNode (int[] playerPos, int[] ballPos)
        {
                  }
0
Comment
Question by:jtcy
  • 3
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
Nick_72 earned 420 total points
ID: 10812434
You're sending just one element from the arrays as parameters, should be:

GameTreeNode root = new GameTreeNode(pPos, pPos);

/Nick

0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 80 total points
ID: 10812442
Also, the arrays are still empty so it won't work anyway
0
 
LVL 9

Assisted Solution

by:Nick_72
Nick_72 earned 420 total points
ID: 10812444
and I guess one of them should be bPos... :)

GameTreeNode root = new GameTreeNode(pPos, bPos);
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Expert Comment

by:CEHJ
ID: 10812445
(probably)
0
 

Author Comment

by:jtcy
ID: 10812457
thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10812472
8-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question