+ 1
Help in Exception handline
when we throw object of some exception and print using println it describes that exception, but when we use overridden tostring method In userdefine exception , if I throw that exception and print it out shows the tostrings statements ... explain it (in both, we use println to print the thrown object but different output comes )
1 Answer
0
When you override a method in a class, instances of that class will perform the overridden method at runtime, rather than the parent method.
Both print() and println() call the toString() method.