java array copy
// Shallow copy
int[] src = {1,2,3,4,5};
int[] dst = Arrays.copyOf(src, src.length);
// Deep copy
int[] dst2 = new int[src.length];
for(int i = 0; i < src.length; i++){
dst2[i] = src[i];
}int[] a = {1,2,3,4,5};
int[] b = Arrays.copyOf(a, a.length);int a[] = {1, 8, 3};
// Copy elements of a[] to b[]
int b[] = a.clone();
Also in Java:
- method overloading
- async in fragment
- java copy array
- how to change text size of textview with code in android studio
- sort elements with sortedset
- get raondom from array java
- get drawable with string android java
- delete element from arraylist
- java download file from url to string
- Java Read Files
- what is java plug-in
- override java
- actionListener java
- print hello world in java
- loop through array java
- how to use spring in java
- java list all non directory files in the directory
- adding an element to the end of a linked list java
- java comments
- how to minimize jframe in java
- how to create an abstract class in java
- Java loop throug gson JsonElement
- dates in java 8
- javafx textarea font size