Hallo, ich habe Quellcode, und würde gern wissen warum der Compiler alle Exeptions bemängelt?
Ausserdem weiss ich nicht was Exeptions sind.
was bedeutet throw new Exeption()?
Was passiert bei catch Exeption e? was bedeutet das e?
hier der
code
Ausserdem weiss ich nicht was Exeptions sind.
was bedeutet throw new Exeption()?
Was passiert bei catch Exeption e? was bedeutet das e?
hier der
Java:
public class Mathematiker {
/**
* @param args
*/
public static void main(String[] args) {
try{
try{
int i=7%5;
if ((i/(i%2))==1){
throw new Exeption();
}
System.out.println("ich mag");
}
catch (Exeption e){
System.out.println("Ich liebe");
try{
if((7%6/(7%6%2))==1){
throw new Exeption();
}
System.out.println("nichts mehr, als");
}
catch(Exeption u){
System.out.println("es,");
}
}
System.out.println("wenn");
try{
int i=true&false ? 0:1;
switch (i){
case 0:
System.out.println("eine Formel");
case 1:System.out.println("ein programm");
default:
throw new Exeption();
}
}
catch (ArithmeticsExeption e){
System.out.println("abbricht.");
}
catch(Exeption e){
System.out.println("funktioniert.");
}
finally{
int i = false && true ? 0:2;
switch (i){
case 1:
System.out.println(";)");
default:
throw new Exeption();
}
}
}
catch (ArithmeticExeption e){
System.out.println(":(");
}
catch (Exeption e){
System.out.println("");
}
}
}