If several return statements are used then how many of them can be executed at a time ?
Share
If several return statements are used then how many of them can be executed at a time ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Verified answer
Answer:
Only one return statement gets executed. If you write more than one return statements and the compiler comes across two return statements consecutively then the compiler may give you an error while compiling. But this doesn't mean you can not use more than one return statements, you may do so but setting appropriate conditions using conditional statements is required,