C#
In C# Exception is root of all exceptions extends base class System.Exception : ISerializable¹ and differs basically between System.SystemException and System.ApplicationException.
Of course, that are a lot of Exception derived directly from System.Exception.
ExternalException, Win32Exception, WebException, IOException, SocketException and all exceptions thrown during os system operations extend SystemException or it's children.
Java
In Java Throwable (root of all errors & exceptions) extends base class object. Error and Exception both extend from Throwable.
Errors such StackOverflowError (endless recursion), OutOfMemoryError (endless allocation) and VirtualMachineError are thrown, when critical limits of java virtual machine exceeded.
C++
In C++ there is no binary split at the root of "exception tree" as in C# (System Exception &
ApplicationException) or in Java (Error & Exception both extend from Throwable).In C++ bad_cast, bad_alloc, bad_function_call, logic_error & runtime_error extend from exception.
Most common Exceptions in C++ extend from logic_error & runtime_error.b.
Keine Kommentare:
Kommentar veröffentlichen