quiz icon indicating copy to clipboard operation
quiz copied to clipboard

Refactor the code to make it look more object-oriented and maintainable

Results 106 quiz issues
Sort by recently updated
recently updated
newest added

- try with resources - Streams -> BufferedStreams

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 :) ![elegant-oop](https://user-images.githubusercontent.com/2372779/84607234-cf17a100-aeb4-11ea-858a-ad0029f59f86.jpg)