Error for the unreachable statement

Fpr the following code:
class exception{
public static void main(String[]args) {
try{
throw new Exception(“mai ni janda agge”);
System.out.println(“hahahah”); //1
}catch(Exception e){
System.out.println("…and the exception is…"+e);
}System.out.println(“i am here”);
}
}

I am getting error whereas mam is able to run the similar type of program.

You cant write any statements after the throw line. Those lines are unreachable hence shows error.
Here, Statement 1 should be above the throw statement and it works fine

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.