but why do i get this?
if there was not a throw statement just after the try block then isnt case 2 and case 3 unreachable statement as they are never reach as x is 1
Code that never will be reached, never used is redundant. It should not bee there. You'll get the same error if you have code after a return statement.