Java Exception vs C++ Exceptions

后端 未结 6 1337
一向
一向 2021-01-12 01:15

Where are exceptions stored ? Stack, Heap. How is memory allocated and deallocated for Exceptions? Now if you have more than one exception which needs to be handled are the

6条回答
  •  时光说笑
    2021-01-12 01:56

    Exceptions in Java are objects, and as such, they are stored on the heap.

    When an exception is thrown, the JVM looks for a matching exception handler in the code. This applies even when there are multiple exceptions that something could throw.

提交回复
热议问题