java copy array
int[] a = {1,2,3,4,5};
int[] b = Arrays.copyOf(a, a.length);// 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];
}
Also in Java:
- java shortest if else statement
- java public private key encryption
- java obtain list string from list object
- setbackground java
- final variables in java
- java android edit text set value
- while loops java
- java observable to observer stack overflow
- basic java coding
- how to compare string in java
- android studio remove notification bar
- sublist in java
- programmation android avoir acces à la liste des intents de partage
- primitive data types in java
- how to iterate hashmap in java
- how to play a clip of audio in java when needed
- how to create a list in java
- processing sound android
- how to initiate a queue in java
- creating a program about user asked to enter a number and enters 0 to stop, then calculates the sum of numbers entered, the average, the length of positive numbers and negative numbers entered by the user in java
- how to format a datetime object to show date and time and milliseconds in java
- java foreach map
- how to print to console in java
- set preference value android