GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 421 of 502    Print  
What is the difference between Assertion and Exception?

  
Total Answers and Comments: 3 Last Update: August 25, 2008     Asked by: sujatham 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 07, 2007 00:15:22   #1  
anil        

RE: What is the difference between Assertion and Excep...
Assertion specifies some condition that should be true during execution of a program. Assertion are of two types. pre assertion and post assertion.

Exception are the mild error condition that your program should encounter during a program run.for example divide by zero.

 
Is this answer useful? Yes | No
August 21, 2008 23:33:07   #2  
raj_sharma Member Since: August 2008   Contribution: 2    

RE: What is the difference between Assertion and Exception?
Exception is a mechanism used by many programming language to describe what to do when something unexpected happens.Assertion is the way to test the certain assumptions about the logic of your program.
 
Is this answer useful? Yes | No
August 25, 2008 02:49:59   #3  
raghuprasad Member Since: August 2007   Contribution: 23    

RE: What is the difference between Assertion and Exception?
There is no concept called Assertion present in Java. Exception is the program error which arises due to uncontrolable condition. This condition can be arised automatically from to program code(Eg. DataBase Connectivity File handling) or condition can be customized and customized exception can be thrown.

Raghu.

If there is a concept called Assertion please write about it

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape