00:01
For this question, we're asked, we're told that, so modern java compilers have optimizers that can detect simple cases when it's logically impossible for a statement in a program to ever be executed.
00:12
In that case, the compiler will warn the programmer about useless code, but this isn't always happen.
00:19
So we're asked to write a short java method that contains code, for which is probably impossible for that code to ever be executed.
00:26
But the java compiler doesn't detect that fact.
00:29
So we just need to write this method.
00:32
So the thing is there's two different types of unusable code.
00:36
There's dead code, which is code that's redundant but still executed either way.
00:42
And the results doesn't add anything to the rest of the program.
00:45
So this just waste cpu performance.
00:49
And then you also have unreachable code.
00:54
And this is code that will never be reached regardless of logic flow...