ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

Java -> System.exit(1)
Posted by Sasha Bar [TNU] 13 Apr 2010 04:03
Why does System.exit(1) get WA instead of Crash?
Re: Java -> System.exit(1)
Posted by Sasha Bar [TNU] 15 Apr 2010 03:31
I want to get CRASH on Timus in run() function, how can i do this?

public class Main implements Runnable {
....public void run() {
........throw new RuntimeException();
....}
....public static void main(String[] args) {
........new Thread(new Main()).start();
....}
}

This code gets WA instead of Crash!


Edited by author 15.04.2010 03:34
Re: Java -> System.exit(1)
Posted by ile 16 Apr 2010 01:05
I didn't check it, but something like this should cause CRASH:

int[] a = new int[10];
System.out.println(a[20]);
Re: Java -> System.exit(1)
Posted by ile 16 Apr 2010 01:06
or...

System.out.println(1/0);
Re: Java -> System.exit(1)
Posted by Sasha Bar [TNU] 17 Apr 2010 17:00
no, it didn't help
Re: Java -> System.exit(1)
Posted by Moonstone 11 May 2010 20:01
Yes, it gets WA... But why? Can anybody explain me?