[Java] 배열객체(String[]) List, ArrayList 변환 JAVA로 개발을 하다보면 배열 객채를 List 객체로 List 객체를 배열 객체로 변환 할 일이 종종 생기게 된다.(필자의 경우 문자열을 특정 문자로 나누어 문자열 배열로 치환한 후 해당 객체에 데이터를 추가하는 작업을 할 경우에 많이 사용한다.) 1. code package khanorder.tistory.com; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class ArrayAndListClass { public static void main(String[] args) { String string = "apple,banan..
[Java] List 객체를 ArrayList 객체로 변환 프로그램 코드를 작성하다 보면 배열(array) 객체를 List형의 객체로 변환하여 사용하는 경우가 있다.1. String[] 객체를 List 객체로 변환String delimiter = " "; List split = Arrays.asList(str.split(delimiter)); 그런데 List 객체는 특정 Index위치에 값을 추가할수 없기 때문에 ArrayList 형으로 사용할 필요가 있다. 2. List 객체를 ArrayList 객체로 변환 String delimiter = " "; List split = Arrays.asList(str.split(delimiter)); ArrayList arrayList = new ArrayList(..
- Total
- Today
- Yesterday
- express
- eGovFrame
- ubuntu
- JSP
- egoverment
- Linux
- Fedora
- 스프링
- MySQL
- 전자정부
- jQuery
- Entity Framework Core
- dotnet core
- Java
- egov
- 하이원
- Spring
- 이클립스
- php
- Windows
- Eclipse
- MariaDB
- c#
- .NET Core
- DART
- 자바
- Flutter
- high1
- asp.net core
- CentOS
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |