Clean Code that Works.

Utility Class

Java/이론..2009. 9. 22. 09:44
In computer programming, a utility class is a class that defines a set of methods that perform common, often re-used functions. Most utility classes define these common methods under static (see Static variable) scope. Examples of utility classes include java.util.Collections [1] which provides several utility methods (such as sorting) on objects that implement a Collection (java.util.collection [2] ).

위키 디피아

일반적으로 자주 쓰이는 메소드들의 집합으로 스태틱 메서드들로 구현되어 있다.
유틸리티 클래스를 생성할 때는 private 생성자를 작성하여 Instance를 생성을 방지 하자. 스태틱 메서드들 뿐이기 때문에 인스턴스 생성이 필요 없다.