Informatiker Board (http://www.informatikerboard.de/board/index.php)
- Themengebiete (http://www.informatikerboard.de/board/board.php?boardid=1)
-- Praktische Informatik (http://www.informatikerboard.de/board/board.php?boardid=6)
--- mit Exception probleme (http://www.informatikerboard.de/board/thread.php?threadid=2128)


Geschrieben von neuling96 am 03.02.2015 um 02:23:

  mit Exception probleme

Mit excpetion ich mich richtig schwer

hier erster ansatz

a) checked information, runtimexception
b)unchecked information
c)?
d) unchecked information
e)checked information



Geschrieben von eulerscheZahl am 03.02.2015 um 09:29:

 

Ich zitiere mal aus der Einleitung:
Zitat:
RuntimeException [...] (diese heißen daher auch unchecked Exceptions)

Bei a) handelt es es sich um eine RuntimeException, aber die ist eben nicht checked. Und wo steht da was von "information"?
b) ist ein Error, unchecked
c) ist eine IOException. Ich lasse dich mal in der Doku schmökern, ob das Runtime ist, oder nicht.
e) nullPointer ist Runtime, siehe a)



Geschrieben von neuling96 am 20.06.2015 um 00:05:

 

Wenn ich eine Exception derart in eine klasse implementiere
code:
1:
2:
3:
4:
5:
6:
7:
8:
public static class FullException extends RuntimeException {
    
    public FullException() {
      super("Tabelle ist voll.");
    }
  }


kann man sie einfach mit throws new FullException(); werfen?


Forensoftware: Burning Board, entwickelt von WoltLab GmbH