-
Notifications
You must be signed in to change notification settings - Fork 394
Expand file tree
/
Copy pathSCArray3.java
More file actions
57 lines (44 loc) · 1.08 KB
/
SCArray3.java
File metadata and controls
57 lines (44 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package scarray3;
public class SCArray3
{
public static void main(String[] args)
{
int A[]={8,6,10,9,2};
System.out.println("Length of A="+A.length);
int B[]=new int[10];
for(int i=0;i<A.length;i++)
{
B[i]=A[i];
}
A=B;
System.out.println("Length of A="+A.length);
}
/*Reverse Copying an Array
public static void main(String[] args)
{
int A[]={8,6,10,9,2,15,7,13,14,11};
int B[]=new int[10];
for(int i=A.length-1,j=0;i>=0;i--,j++)
{
B[j]=A[i];
}
for(int x:B)
{
System.out.println(x+",");
}
}*/
/* copy array Ato B
public static void main(String[] args)
{
int A[]={8,6,10,9,2,15,7,13,14,11};
int B[]=new int[10];
for(int i=0;i<A.length;i++)
{
B[i]=A[i];
}
for(int x:B)
{
System.out.print(x+",");
}
} */
}