cancel
Showing results for 
Search instead for 
Did you mean: 

How to add two String[] to a third one

Former Member
0 Kudos

I've two string:

String[] customers = getCustomerUsers();

String[] employees = getEmployeeUsers();

Is it possible to combine these array's?

Accepted Solutions (1)

Accepted Solutions (1)

luciano_leitedasilva
Contributor
0 Kudos

Hi there,

String[] customers = getCustomerUsers();

String[] employees = getEmployeeUsers();

.

.

.

Object[] people = new Object[]{customers, employees};

It is a combination, right?

Regards,

Luciano

Former Member
0 Kudos

It is a combination, right. But is it also possible to skip the object and type it like a String[]?

Former Member
0 Kudos

Hi,

This can be done efficiently with System.arrayCopy().

check this link

<a href="http://www.devx.com/tips/Tip/5287">Array Copy</a>

HTH

regards

Vivek Nidhi

Former Member
0 Kudos

Thanks a million, that solution works fine.

Answers (1)

Answers (1)

Former Member
0 Kudos

what exactly do u mean by combine?