Skip to content

Conversation

Th-Shivam
Copy link

feat: Add eager and lazy initialization examples for Singleton pattern

  • Add EagerInitializedSingleton with class loading time initialization
  • Add LazyInitializedSingleton with synchronized lazy loading
  • Update App.java to demonstrate both approaches with clear logging
  • Update README.md with comprehensive documentation for all singleton types
  • Add corresponding unit tests for both implementations
  • All tests passing (21/21)

Copy link

github-actions bot commented Oct 6, 2025

Analyzing changes in this PR...

This might take a few minutes, please wait

📥 Commits

Analyzing changes from base (ede37bd) to latest commit (1cfbf30):

  • 1cfbf30: Fixes missing eager/lazy initialization examples for Hacktoberfest contributors
📁 Files being considered (6)

🔄 singleton/README.md (2 hunks)
🔄 singleton/src/main/java/com/iluwatar/singleton/App.java (1 hunk)
➕ singleton/src/main/java/com/iluwatar/singleton/EagerInitializedSingleton.java (1 hunk)
➕ singleton/src/main/java/com/iluwatar/singleton/LazyInitializedSingleton.java (1 hunk)
➕ singleton/src/test/java/com/iluwatar/singleton/EagerInitializedSingletonTest.java (1 hunk)
➕ singleton/src/test/java/com/iluwatar/singleton/LazyInitializedSingletonTest.java (1 hunk)


autogenerated by presubmit.ai

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant