Skip to content

굳이 Eager Loading을 하는 이유가 있을까요? #5

Description

@koreanNomadDevs

아래의 소스에서

private static Coin instance = new Coin(); // Eagerly Loading of singleton instance

굳이 Eager Loading을 하는 이유가 있을까요?

getInstance() 메소드 내에서 Coin instance가 null 인지 체크 후 null일때만 인스턴스를 만드는 것이 좋을 것 같습니다.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions