Wednesday, 21 August 2013

Can I make this work? Instantiating new arrays with class calls

Can I make this work? Instantiating new arrays with class calls

I am trying to make my own class where one of the parameters is an array.
public class Node {
int i;
String title;
int[] links;
Node(int i, String title, int[] links){
this.i = i;
this.title = title;
this.links = links;
}
}
Can I make this work? I want to call it by doing something like Node(4,
"Title", [1,2,3])

No comments:

Post a Comment