When should we create our own custom exception classes? - Java

When should we create our own custom exception classes?

The term exception lets the programmer to know that there is something exceptional has occurred in the program. Apart from Java exception class library, a custom exception can be created by the developer. This customization gives the power to deal with application centric exceptions. For instance, in a banking application a customer tries to withdraw amount which results in below the minimum balance. In this scenario, the developer needs to implement a customized exception.
What are primitive type wrappers classes? - Java
Primitive type wrapper classes or simply wrapper classes are available in java.lang package for providing object methods for all the eight primitive types. All the wrapper class objects are immutable...
Why do you recommend that the main thread be the last to finish? - Java
In an application, a program continues to run until all of the threads have ended. Hence, the main thread to finish at last is not a requirement. It is a good programming practice to make it to run last to finish...
Why does Java have two ways to create child threads?
Java threads can be created graciously in two ways: implementing the Runnable interface and extending Thread class...
Post your comment