[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Technical Discussion :: WebMethod

47 / 166

Explain try & catch block?

Answer:

The try-catch block works the same way as Java. It is 3 sequence step Main, Try and Catch block. You execute a sequence of steps, if you faced unexpected exception/error you skip the processing and execute the catch block.


To define the Try-Catch block, follow the following steps:


- Create a new flow service using SoftwareAG designer.
- Create a new sequence and call it 'Main'.
- Create another two sequence under the 'main' sequence; call them, 'Try', and 'catch'.



Go to the properties of each sequence and configure the 'exit on' as follows:
* 'Success' for the 'Main' sequence.
*'Failure' for the 'try' sequence.
* 'Done' for the catch sequence.



The main sequence has the try, and Catch sequences. So by defining the 'exit on' parameter of for the main to 'Success', this means that if the first sequence (Try) finished successfully then exit the sequence 'Main' and the 'Catch' Block/sequence will not be executed.



The 'Try' sequence is configured to 'exit on' = 'failure', which means if one step failed, all the steps following the failed step in the 'Try' block will not be executed, and the code will jump to execute the 'Catch' block/sequence.
The 'Catch' block is configured to 'exit on' = 'done' which means that each step in the 'Catch' block must be executed regardless of the result of each step.

Asked In :: Virtusa

Post Your Answer Here:


Rate This: +0 -0     
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Rate This: +0 -0     
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Most Popular Qs.