Java System.arraycopy metodu

Posted: September 8, 2014 in Java
Tags: ,

Dizi kopyalama metotudur.

public class JavaApplication3 {

public static void main(String[] args) {

int[] bayram = {1,5,7,9};
int[] bayram2 = new int[4];
System.arraycopy(bayram,0,bayram2,0,4);
for(int a=0; a<bayram2.length; a++)
System.out.println(bayram2[a]);

dizi5

bayram -> kaynak dizi
0->kaynak dizinin başlangıç adresi
bayram2->hedef dizi
0->hedef dizinin başlangıç adresi
4 -> kopyalama adedi

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s