Nikhil you can edit your message using
button if you write something wrong or press submit by mistake.
On changing the reference to
ScrapCode ref = new ScrapCode();
It still give compile error
But if you see the error, when the code is Code ref = new ScrapCode();, then the error will be Exception must be caught or thrown, and when the code is ScrapCode ref = new ScrapCode();, then it will say IOException must be caught or thrown. Do you understand the difference now??