Java icon indicating copy to clipboard operation
Java copied to clipboard

Update HashMap.java

Open sunilnitdgp opened this issue 2 years ago • 6 comments

Changes

SOLID Principles:

Single Responsibility Principle: Each class (HashMap, LinkedList, Entry) has a clear single responsibility. For example, the HashMap class manages the hash map, LinkedList handles linked list operations, and Entry represents a key-value pair. Open-Closed Principle: The code is designed to be open for extension (e.g., adding new methods) but closed for modification (existing methods are not changed). Reliable:

Improved code readability and maintainability by following SOLID principles and Java conventions. Added bounds checking to handle potential IndexOutOfBoundsException. Extensible:

The code is extensible, allowing for future additions of methods or features without modifying existing code. This is achieved by adhering to the Open-Closed Principle. Javadoc Comments:

Added Javadoc comments to provide comprehensive documentation for each class and method, enhancing code understanding and usability.

  • [ ] I have read CONTRIBUTING.md.
  • [ ] This pull request is all my own work -- I have not plagiarized it.
  • [ ] All filenames are in PascalCase.
  • [ ] All functions and variable names follow Java naming conventions.
  • [ ] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • [ ] All new code is formatted with clang-format -i --style=file path/to/your/file.java

sunilnitdgp avatar Oct 09 '23 11:10 sunilnitdgp

I request the maintainer(s) to merge my request using "hacktoberfest-accepted" label.

sunilnitdgp avatar Oct 09 '23 14:10 sunilnitdgp

can you plss help me how to resolve that issue related to clang-format??

Jyotishmoy12 avatar Oct 09 '23 18:10 Jyotishmoy12

Hi @Jyotishmoy12 You can check the Clang format linter build logs and you can see some + and -, and if your build failed. That means you need to remove those '-' lines and add '+' lines with mentioned formatting.

sunilnitdgp avatar Oct 10 '23 13:10 sunilnitdgp

Thanks a lot for your help!

On Tue, 10 Oct 2023, 6:35 pm D.Sunil, @.***> wrote:

Hi @Jyotishmoy12 https://github.com/Jyotishmoy12 You can check the Clang format linter build logs and you can see some + and -, and if your build failed. That means you need to remove those '-' lines and add '+' lines with mentioned formatting.

— Reply to this email directly, view it on GitHub https://github.com/TheAlgorithms/Java/pull/4746#issuecomment-1755392357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHRKHPDKV65V22CXZXWYCDX6VB2RAVCNFSM6AAAAAA5YVX23KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVGM4TEMZVG4 . You are receiving this because you were mentioned.Message ID: @.***>

Jyotishmoy12 avatar Oct 11 '23 02:10 Jyotishmoy12

@siriak Please review this one as well.

sunilnitdgp avatar Oct 12 '23 17:10 sunilnitdgp

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 12 '23 00:11 github-actions[bot]

Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

github-actions[bot] avatar Jan 01 '24 00:01 github-actions[bot]