Solved

Parsing array

Posted on 2004-04-13
6
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 136
import as existing maven project 3 77
What browser will run Java? 7 177
Delete .class files at every compile 4 57
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

739 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