fork download
  1. import java.sql.SQLException;
  2.  
  3. class Exption<T extends Exception> {
  4. public static void main(String[] args) {
  5. try {
  6. new Exption<RuntimeException>().pleaseThrow(new SQLException());
  7. }catch (final SQLException ex){
  8. ex.printStackTrace();
  9. }
  10. }
  11. private void pleaseThrow(final Exception t) throws T{
  12. throw (T)t;
  13. }
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:7: error: exception SQLException is never thrown in body of corresponding try statement
        }catch (final SQLException ex){
         ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
stdout
Standard output is empty