piano imagemap test

piano H-1 C0 CIS0 > D0 DIS0 E0 F0 FIS0 G0 GIS0 A0 B0 H0 C1 CIS1 D1 DIS1 E1 F1 FIS1 G1 GIS1 A1 B1 H1 C2 CIS2 D2 DIS2 E2 F2

Labels

Wirtschaft (156) Pressefreiheit (152) Österreich (125) IT (110) code (70) Staatsschulden (37) EZB (27) Pensionssystem (16) Geopolitik (13)

2025-09-12

Exception handling in C#, Java, C++

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.

In java some exceptions like IOException or SocketException are "checked at compile time". This does NOT mean, that javac compiler knows when IOException or SocketExcpetion will be thrown at program flow at runtime. Furthermore javac compiler knows if reading from or writing to a file needs catching an IOExceptiuon, because disk might be full or USB stick could be unplugged or fs mount point is now unmounted or remounter ro. When reading from or writing to a socket javac compiler knows, that you must catch a SocketException in case of a linux system init runlevel 1 or 2, unplugging USB network adapter or dog bites CAT5 or CAT7 network cable.

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