Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Copy an array elments into another array
import java.lang.*; class Rextester { public static void main(String args[]) { int arr1[] = new int[10]; int arr2[] = new int[10]; int i; for(i=0;i<10;i++) { int a=i+1; arr1[i] = a; } System.out.println("Elements of Arrays are : "); for(i=0;i<20;i++) { if(i<10) { if(i==0){ System.out.println("Array 1 : "); } System.out.print(arr1[i]+" "); } else { if(i==10){ System.out.println("\nArray 2 : "); } System.out.print(arr2[i-10]+" "); } } System.out.println("\nAfter Copy : "); for(i=0;i<20;i++) { if(i<10) { arr2[i]=arr1[i]; } else { if(i==10){ System.out.println("Array2 : "); } System.out.print(arr2[i-10]+" "); } } } }
run
|
edit
|
history
|
help
0
4a
exp.1A
메소드구현하기-해결
Sorting array
[JAVA] Cool thing about iterating a map with iterator.
Print out perfect numbers 0 – 10,000
"Naive" recursion vs. Dynamic Programming
Use of JS in Java (not my)
motifCatur
Bound Types