자바 array reverse

1 개요[ | ]

자바 array reverse
Java 배열 뒤집기
// import java.util.Arrays;
// import org.apache.commons.lang3.ArrayUtils;
String[] fruits = {"Apple","Banana","Orange","Mango"};
ArrayUtils.reverse(fruits);
System.out.println( Arrays.toString(fruits) );
// [Mango, Orange, Banana, Apple]
// import java.util.Arrays;
// import org.apache.commons.lang3.ArrayUtils;
String[] fruits = {"Apple","Banana","Orange","Mango"};
String[] reversed = fruits.clone();
ArrayUtils.reverse(reversed);
System.out.println( Arrays.toString(reversed) );
// [Mango, Orange, Banana, Apple]

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}