| Author |
Difference
|
vineet walia
Ranch Hand
Joined: Feb 16, 2008
Posts: 138
|
|
|
what is Difference between throw and throws ?
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4967
|
|
The letter 's'.
A method declares the exceptions it throws with the throws clause. When you actually create an exception, you throw it.
-Cameron McKenzie
|
Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
|
 |
vineet walia
Ranch Hand
Joined: Feb 16, 2008
Posts: 138
|
|
vineet walia wrote:what is Difference between throw and throws ?
any body also provide example to explain this?
|
 |
John Bengler
Ranch Hand
Joined: Feb 12, 2009
Posts: 132
|
|
Or have a look at this thread:
Exception handling throw and throws
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4967
|
|
It's always wise to search the ranch. There's always lots of great wisdom to be had!
-Cameron McKenzie
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6590
|
|
The letter 's'.
throws tells you that a method throws some sort of exception. With throw you well, umm, throw an exception from the method.
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
 |
|
|
subject: Difference
|
|
|