dcsimg

Which kind off error can stop jvm in java??

Simon Ablett

Actually, the JVM will exit if unchecked-exceptions (for example RuntimeException etc) are not caught.

public class T1
{
  public static void main( String [] args )
  {
    T1 t1 = new T1();

    while(true)
    {
      t1.run();
    }
  }

  private void run( )
  {
    throw new RuntimeException("Test");
  }
}
Regards.