목록Java (3)
Hansel
보호되어 있는 글입니다.
Static Field the keyword static means that the particular member belongs to a type itself, rather than to an instance of that type. This means we'll create only one instance of that static member that's shared across all instances of the class. From the memory perspective, static variables are stored in the heap memory. public class Car { private String name; private String engine; public static..

스트림 API 스트림이란 무엇인가? 자바의 대부분 애플리케이션은 컬렉션을 만들고. 처리하는 과정을 포함한다. 자바에서는 컬렉션으로 데이터를 그룹화하고 처리할 수 있다. 스트림 없는 코드 메뉴들 중에서 칼로리가 400 이하인 메뉴만 골라 해당 메뉴를 다른 컬렉션에 저장하고 칼로리를 기준으로 정렬하는 코드이다. 스트림 사용 코드 스트림을 사용하니 로직이 더 명확하며 명시적이다. 코드가 더 간결한 것은 당연히 보인다. Stream 대신 parallerStream을 사용하면 멀티코어 아키텍쳐에서 병렬로 실행할 수 있다. 속도측면에서 얼마나 좋은지는 다음에 설명한다. 자바 8의 스트림 API의 특징은 다음과 같다. 선언형 : 더 간결하고 가동석이 좋다. 조립할 수 있다. : 유연성이 좋아진다. 병렬화 : 성능이 ..