Skip to content

Refactor: Replace Magic Strings with Command Constants #4

@jayambe36

Description

@jayambe36

Currently, the command strings like "dir", "date", "time", and "exit" are hardcoded directly in the switch statement in MyCMD.java. This use of "magic strings" can lead to typos and makes the code harder to maintain.

This issue proposes refactoring the code to define these command strings as private static final constants. This improves code readability, reduces the chance of errors, and makes it easier to manage command names in one central place

Please assign me this issue to submit this as a PR under the hacktoberfest, hacktoberfest2025, and hacktoberfest-accepted labels.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions