What factors should be taken into account for Custom Exceptions

hi,I just want to know that What factors should be taken into account for making Custom Exceptions.any examples will appreciated.regards,vjoy
[176 byte] By [vjoyweba] at [2007-10-2 14:44:11]
# 1
What do u mean by custom exception?
srikanta at 2007-7-13 13:15:53 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2
Custom exceptions means that I want to make my own exceptions by extending Exception class.My question is that What factors should taken into account while I am creating my own exceptions(user defined exceptions )
vjoyweba at 2007-7-13 13:15:53 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3

Do you want this to be checked exception? If so extend it from Exception or subclass of it. If it is unchecked exception (not forced by javac to be caught by callers), then extend it from RuntimeException or subclass of it. Exceptions are serializable objects and so have serialVersionID field. Also, to allow for exception chaining, define a constructor that accepts "cause" (http://java.sun.com/j2se/1.4.2/docs/guide/lang/chained-exceptions.html)

sundararajan.aa at 2007-7-13 13:15:53 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...