객체 생성

Old Posts/Effecttive Java

Item04. 객체 생성을 막을 때는 private 생성자를 사용하라 <이펙티브자바>

README Item 04 : 객체 생성을 막을 때는 private 생성자를 사용하라 (Enforce noninstantiability with a private constructor) 객체 생성을 막는 것에는 어떤것들이 있을까? java.lang.Math java.util.Arrays java.util.Collections (위 클래스들은 객체를 만들 목적의 클래스가 아니다.) 1. java.lang.Math public final class Math { /** * Don't let anyone instantiate this class. */ private Math() {} public static final double PI = 3.14159265358979323846; public static in..

bactoria
'객체 생성' 태그의 글 목록