diptangsu / Data-Structures

This contains all the programs for data structures that are a part of the syllabus of MAKAUT 2nd year Computer Science and engineering course.
17 stars 33 forks source link

Modify error handling with exception handling #8

Open diptangsu opened 5 years ago

diptangsu commented 5 years ago

For example, for the file Stack.java, pushing into a full-stack is prevented by an if-else block, change all such occurrences with user-defined exceptions.

lelloman commented 5 years ago

Hi, I'd like to pick this one up for hacktoberfest. I'm not entirely sure I understood what you mean by "user-defined exceptions". I was thinking to throw specific RuntimeException, to follow your example, defining a FullStackException extends RuntimeException and throw an instance of that. Would it be OK?

diptangsu commented 5 years ago

@lelloman ofcourse.

lelloman commented 5 years ago

Great thanks, then I'm gonna do it :)