Runnable(java.lang)

apayaya·2022년 9월 19일
0

java - process, thread

목록 보기
1/1

Runnable

  • @FunctionalInterface
  • 재사용성을 위해서 구현 클래스 정의 or lambda expression으로 구현

abstarct method

  • run() -> void : 작업 스레드가 실행할 코드

-Task

Naming a class that implements java.lang.Runnable with the suffix "Task" is a common naming convention in Java. This is because a class that implements Runnable can be used to represent a unit of work that can be executed in a separate thread. By using the "Task" suffix, it becomes clear that the class represents a task that can be run in a separate thread.

  • DownloadFileTask, ImageProcessingTask
profile
java 정리

0개의 댓글