Sunday, 15 April 2012

Is there something similar to array[1:] in java? -


Working with an array of strings and I want to call a method with a parameter, in which parameter 1 index End from In Python, this looks like something like array [1:], and I'm searching for something similar in Java, but nothing, thanks!

No you have to pass the initial index and (possibly) end index, it will look like this:

  public static zero doThing (int [] array, int start) {// something to do here [start] doThing (array, start + 1); }    

No comments:

Post a Comment