Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why don SWTError and SWTException override all printStackTrace methods?

methods override swtexception
0
Posted

Why don SWTError and SWTException override all printStackTrace methods?

0

SWTError and SWTException each contain a slot which records the original exception (if it is known) that caused the SWTError or SWTException to be thrown. The printStackTrace() method in these classes has been overridden to print the stacktrace of the original exception as well. The problem with the other two API methods (i.e. printStackTrace(PrintStream) and printStackTrace(PrintWriter)) is that the classes mentioned in their arguments (PrintStream and PrintWriter) are not available in the CLDC class library. Because we need to maintain compatability with CLDC, we can not override them.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123