강의

멘토링

커뮤니티

Inflearn Community Q&A

inyoungeun's profile image
inyoungeun

asked

Lecture 1 for Java Basics

Thread Sample Lab

질문 드립니다.

Written on

·

241

0

안녕하세요!

StringFactioryProcess 클래스에서 질문 있습니다.

    public static Queue<String> rawMaterialPlasticList = new LinkedList<>();
    public static Queue<Map<String, Integer>> productStringList = new LinkedList<>();
    public static Queue<Map<Integer, Map<String, Integer>>> inputList = new LinkedList<>();

위 코드에서 왜 ArrayList가 아닌 LinkedList가 사용되었나요?

java

Answer 1

0

JeongTaeHyun님의 프로필 이미지
JeongTaeHyun
Instructor

Arraylist와 linkedlist는 같은 리스트이지만

특징이 다릅니다.

Array리스트는 순차적인 처리에 좋고

Linkedlist는 중간에 변경되는 게 많을 때

좋다라고 알아두시면 됩니다.

Linkedlist를 예제로 사용한 건 제 취향입니다.

inyoungeun's profile image
inyoungeun

asked

Ask a question