Dishan Fernando said:
is there any way to get the Error Code or Number related to the error ?
(Say within catch bolck)
Is java support that type of thing ?
There is no general concept of an error code or error number in Java.
Instead, there are exception classes, which are far more functional,
since they can contain any kind of data you like. It would be very bad
form for any Java library to define and generate error numbers or error
codes, when it could have thrown exceptions instead.
However, there are some cases where error codes or numbers are available
for specific exceptions, especially when you're interacting with an
external resource that might provide an error code of some kind. For
example, SQLException has methods called getSQLState (returns a DBMS-
independent standard error code) and getErrorCode (return an internal
error code whose meaning depends on the DBMS, but which might be more
specific than the SQLState specification provides for.)
What can i get from hashCode ?
What you can get from hashCode is a relatively meaningless number, the
only guarantee about which is that if two objects return true from
"a.equals(b)", then their hashCode() implementations will return the
same number. Since exception subclasses typically will never return
true from "equals()" except when compared to themselves, this isn't
terribly useful to you. Hash codes are used in certain data structures
to store objects, but are not at all useful when attempting to interpret
objects.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation