This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can Constructors throw Exceptions??

 
N Mukherjee
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,
Can any constructor throw Exception?
Plz give reasons.Pardon my ignorance.
Regds
NM
 
Bharatesh H Kakamari
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tes Constructors can throw Exceptions.
The reason for constructors throwing exceptions are the same for any method throwing / handling Exceptions.
 
Hemal Mehta
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Constructors can have returns provided its just return;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic