fork(2) download
  1.  
  2. class Coin extends Exception{
  3. public boolean side=java.util.concurrent.ThreadLocalRandom.current().nextBoolean();
  4. }
  5.  
  6. class StockMarket
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. System.out.print(predict());
  11. }
  12. String predict()
  13. {
  14. try{
  15. throw new Coin();
  16. }catch (Coin n){
  17. if (n.side) return "Котировки будут расти";
  18. else return "Котировки будут падать";
  19. }
  20. }
  21.  
  22. }
  23.  
Compilation error #stdin compilation error #stdout 0.07s 32672KB
stdin
Standard input is empty
compilation info
Main.java:10: error: non-static method predict() cannot be referenced from a static context
		System.out.print(predict());
		                 ^
1 error
stdout
Standard output is empty