Solved

Parsing array

Posted on 2004-04-13
6
196 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 105 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 20 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 105 total points
ID: 10812444
and I guess one of them should be bPos... :)

GameTreeNode root = new GameTreeNode(pPos, bPos);
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
firstswap challenge 20 67
session migration servlets 2 25
diffSum example 4 24
object oriented programming comparison 5 54
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now