Skip to content

Instantly share code, notes, and snippets.

@dogeared
Created October 6, 2011 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogeared/1268518 to your computer and use it in GitHub Desktop.
Save dogeared/1268518 to your computer and use it in GitHub Desktop.
Java copyOfRagne example
import java.util.*;
public class t {
public static void main(String[] args) {
String[] s = {"1", "2", "3"};
String[] t = Arrays.copyOfRange(s, 1, 3);
System.out.println("Length of t: " + t.length);
System.out.println(t[0]);
System.out.println(t[1]);
}
}
@dogeared
Copy link
Author

dogeared commented Oct 6, 2011

Length of t: 2
2
3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment