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.
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact