選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ExplicitConstructorThrows.java 427B

123456789101112131415161718192021222324
  1. import java.io.IOException;
  2. public class ExplicitConstructorThrows extends Base { //ERR: default constructor throws IOException
  3. }
  4. class Base {
  5. Base() throws IOException { }
  6. }
  7. class Sub1 extends Base {
  8. Sub1() {
  9. super(); //ERR: throws IOException
  10. }
  11. }
  12. class Sub2 extends Base {
  13. Sub2(String s) {
  14. this(); //ERR: throws IOException
  15. }
  16. Sub2() throws IOException {
  17. super();
  18. }
  19. }