What is meant by "unreachable code" ? Can you write a code segment explaining this ?
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. What is meant by "unreachable code" ? Can you write a code segment explaining this ?Core Java
Ans. Unreachable code is a code segment that can never be executed in any case. For example -

int x = 5;
return;
System.out.println(x);

In this code , 2nd line will return the control out of the method and hence 3rd line will never get executed and hence is unreachable code. This will be caught at compile time only.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     unreachable code



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: