「Java」RuntimeExceptionのサンプル

2021年7月28日

説明
RuntimeExceptionは、Java仮想マシンの通常の処理でスローすることができる各種の例外のスーパー・クラスです。

使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
int count = 0;
try {
    count = Integer.parseInt(文字列);
} catch (Exception e) {
throw new RuntimeException();
}
int count = 0; try {     count = Integer.parseInt(文字列); } catch (Exception e) { throw new RuntimeException(); }
int count = 0;
try {
    count = Integer.parseInt(文字列);
    } catch (Exception e) {
   throw new RuntimeException();
}

 

Java

Posted by arkgame