Rein vom Programmablauf gibt es nur einen minimalen Unterschied:
beim .exit verlässt du das Programm sofort, egal wo du gerade warst.
Bei einem try{...throw...}catch(...){../*hier*/.} kannst du noch etwas ausführen (da wo das "hier" steht). Außerdem wandert die Exception durch alle Unterprogramme bis sie gefangen wird. Du kannst damit also erheblich mehr machen.
Wenn du weiter Java oder C++ Programmieren willst solltest du dir Exceptions so oder so mal anschaun. Sie sind ziemlich praktisch.
Jak
____________________________________
Join the DNRC | Godwin\'s Law (thx@stona)
Documentation is like sex: If it\'s good, it\'s very, very good. If it\'s bad, it\'s better than nothing.
\"In theory, theory and practice are the same. In practice, they are not\" (Lawrence Berra)
|