IT資格無料解き放題

Java Silver SE17 練習問題

50

Oracle Certified Java Programmer, Silver SE 17(1Z0-825-JPN) / 全 50

この問題は に最終確認しました

Java Silver SE17 · 50 / 50

このプログラムを実行した結果として正しいものはどれか。

 1: class DriveException extends Exception {
 2:     DriveException(String m) { super(m); }
 3: }
 4: class SpoolException extends Exception {
 5:     SpoolException(String m) { super(m); }
 6: }
 7: public class Archive {
 8:     static void save(int k) throws DriveException, SpoolException {
 9:         if (k == 1) {
10:             throw new DriveException("drive full");
11:         }
12:         throw new SpoolException("end");
13:     }
14:     public static void main(String[] args) {
15:         try {
16:             save(5);
17:         } catch (DriveException | SpoolException e) {
18:             System.out.println("both " + e.getMessage());
19:         } catch (Exception e) {
20:             System.out.println("one " + e.getMessage());
21:         }
22:     }
23: }
← 前の問題50 / 50次の問題 →

つぎに、どうしますか

Java Silver SE17 のページへ戻る問題の一覧へ

数はここで、仕上げは道場で。ここで数をこなしたら、道場へ。出るところだけの模試とテキストで、最短で仕上げる。 記述式・コマンド入力・模試まで本番形式で仕上げるなら資格道場へ。