Selasa, 20 September 2016

What is the difference between throw, throws and finally in java

In this article we will look at the use of throw throws and finally keywords of exception handling in Java programs.   throw Keyword The throw keyword can be used in Java programs to throw exception objects explicitly. The syntax of using throw is as follows: throw ThrowableInstance; The ThrowableInstance can be object of Throwable class or any of its sub classes. A reference to the Throwable instance can be obtained using the parameter in catch block or by using the new operator. Let’s see a sample program that demonstrates the use of throw: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class ArrayException {

The post What is the difference between throw, throws and finally in java appeared first on Coding Security.


What is the difference between throw, throws and finally in java
read more

Tidak ada komentar:

Posting Komentar