new throws an exception OutofmemoryException if unable to allocate memory.
But in general I have seen after wherever we are doing new we don't enclose in try catch block.
Is there any specific reason? or what are the coding guidelines for using new
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit GuptaRank #190 · 12.8K reputationPosted Mar 29, 2018, 9:37 AM EDT
zarana agrawal26 reputationPosted Mar 29, 2018, 9:30 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Mar 29, 2018, 6:04 PM EDT
Nanddeep NachanRank #38 · 35.2K reputationPosted Mar 28, 2018, 8:53 PM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Mar 28, 2018, 10:41 PM EDT