Java

Java

[Spring] Custom Annotations for Spring Integration Tests

Introduction Annotations are one of the powerful features in Java and Spring that allow for declarative behavior without boilerplate code. They're especially useful in configuring integration tests in Spring applications. This article aims to unpack a custom annotation, @SpringIntegrationTest, designed to streamline Spring integration tests. By the end of this read, you will understand each of i..

Java

[Java] lambda expression 에서 local variable 값을 변화시킬 수 없는 이유

Problempublic class Main { public static void main(String[] args) { List someList = List.of(0, 1, 2); int counter = 0; someList.forEach(something -> { counter++; }); }}위 코드의 build 는 fail 됩니다. 에러메세지는 다음과 같습니다.java: local variables referenced from a lambda expression must be final or effectively finallambda expression 에선 final or ef..

sjoonb
'Java' 카테고리의 글 목록