Skip to content
Search

Java.lang.UnsupportedOperationException

lastmod 2025-02-14created 2020-01-222 edits

When designing a constant set class to represent things like a program's representative constants, you can prevent object creation as follows.

package default;

/**
 * 프로그램 대표 상수 집합을 위한 유틸리티 클래스.
 * @author your name
 */
public final class DefineOption {

    /**
     * 객체 생성을 막기 위한 protected 기초생성자.
     * @throws UnsupportedOperationException
     */
    protected DefineOption() {
        throw new UnsupportedOperationException();
    }
}

See also

author Zer0 sitemap