Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Where we use assertion in java programming?

Answer Posted / saipratapreddy maddireddy

->assertions are using for debugging/ testing the flow of
program at the time of development and testing phases not
yet deployment phase.
we can use the assertions any where in java program is
valid but we have to use it in appropriate way.
->the syntax of Assertion is:
assertion(boolean): value;
*we can take any value after colon(:) that may be int,
char,string and method call
when ever assertion parameter is "true" then it will
proceed the remaining execution of program otherwise it
throw an exception saying"java.lang.AssertionError:xxxx"
assertion for testing purpose if assumption value is
false then it raises an exception but to handling this
exception by using "try-catch-finally" is not recommended.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to retrieve warnings?

996


How do we configure init params for jsp?

992


What is the difference between "JTable" and "JTGrid"? can they be used interchangeably?

2223


What is jsp and how it works?

951


Explain lifecycle methods.

1071


How do I use a scriptlet to initialize a newly instantiated bean?

990


How can we stop errors on display in a jsp page?

949


What are the advantages of jstl?

947


How to include a jsp file in another jsp file?

951


How do you pass control from one jsp page to another?

957


How is jsp better than servlet technology?

1059


What information is needed to create a tcp socket?

957


What is a jsp page?

1019


What does it mean when tags or attributes are said to be deprecated?

995


What is session getattribute in jsp?

1004