[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Parsing array

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
jtcy
Asked:
jtcy
  • 3
  • 2
3 Solutions
 
Nick_72Commented:
You're sending just one element from the arrays as parameters, should be:

GameTreeNode root = new GameTreeNode(pPos, pPos);

/Nick

0
 
CEHJCommented:
Also, the arrays are still empty so it won't work anyway
0
 
Nick_72Commented:
and I guess one of them should be bPos... :)

GameTreeNode root = new GameTreeNode(pPos, bPos);
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
CEHJCommented:
(probably)
0
 
jtcyAuthor Commented:
thanks
0
 
CEHJCommented:
8-)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now