quiz
quiz copied to clipboard
Refactor the code to make it look more object-oriented and maintainable
- try with resources - Streams -> BufferedStreams
Refactor
Java quiz Is it necessary to retain Parsers's contract (API)? I don't know was there any intention to see how one can read from file using no Files utilities or...
We make class `Parser` immutable.
Code refactoring + Synchronized methods getContent(), getContentWithoutUnicode, saveContent() + Replaced String by StringBuilder in getContent() and getContentWithoutUnicode() methods + Replaced FileInputStream by FileReader in getContent() method + Optimazed reading by...
## choices - Keep minimal amount of code - Keep nesting as flat as possible - Try to have sefl explanatory code (remove comments) - Use wisely `var` and `->`...
- Strategy pattern - ReadWriteLock - try with resources - set File with constructor - final (constant) unicode char - i + 1 -> i ++ (normal increment) - Buffer...
Replaced method locks with immutability. Removed redundant operations. Used buffered output for write since there was no need to check input char by char. Wrapped checked exceptions in runtime to...
Tried to apply tricks from the book. Thanks for it :) 