Java Array:
- We can copy an array to another by the arraycopy() method of System class..
- we can increase an array length without any data loss by using copyOF method of array .
The example below uses the weekday number to calculate the weekday name:
Java Array:
- We can copy an array to another by the arraycopy() method of System class..
- we can increase an array length without any data loss by using copyOF method of array .
Types of Array in java:
- Single Dimensional Array.
- Multidimensional Array.
Single Dimensional Array in Java:
int []b = {1,2,3};
int [] n=Arrays.copyOf(b, 5);
n[3]=4; n[4]=5;
for(int i=0;
i<n.length; i++)
{ System.out.println(n[i]); }
Visited 1 times, 1 visit(s) today
