• 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