When to use throws keyword in JAVA || Try Catch vs Throws || Exception handling in java

Описание к видео When to use throws keyword in JAVA || Try Catch vs Throws || Exception handling in java

This tutorial covers Throws keyword uses in java.It's a bit confusing when should we use Throws keyword and when should we use try and catch.So
today in this tutorial we are going to simplify these things with few examples.

In the context of exception handling in java we can differentiate methods as two types :
1.common methods
2.Specific methods

Common methods :
Common methods always deals with common requirements which are suitable for all the java programmers
eg: parseInt(“ “ )

Specific methods :
specific methods always deals with specific requirements of an individual
eg : myMethod1() { }

when a common method has any exception, Industry recommends expressing those exceptions by using Throws keyword.The common methods are
going to be used by the programmers.

When specific methods has any exception it is recommended to handle those exceptions by using try catch in Java as the specific methods are
going to be used by the end users.


So we are going to learn more about throws keyword in java as we progress with this tutorial.

If we can understand this we can easily say the differences between throw and throws in java.

=============
Please subscribe to my channel by clicking on the link below.

   / @seleniumexpress  

Stay tuned and like my Facebook page for more.

  / seleniumexpress  


Music :
-----------
credits : -

Adventures by A Himitsu   / a-himitsu  
Creative Commons — Attribution 3.0 Unported— CC BY 3.0
http://creativecommons.org/licenses/b...
Music released by Argofox    • A Himitsu - Adventures [Royalty Free ...  
Music provided by Audio Library    • Adventures – A Himitsu (No Copyright ...  


-----

intro template :
wwww.youtube.com/Alexbau01

images used :
By Mrudit161187 (Own work) [CC BY-SA 4.0 (https://creativecommons.org/licenses/...)], via Wikimedia Commons
By Shrutica (Own work) [CC BY-SA 4.0 (https://creativecommons.org/licenses/...)], via Wikimedia Commons
By Barthateslisa (Own work) [CC BY-SA 4.0 (https://creativecommons.org/licenses/...)], via Wikimedia Commons
By Harsha K R from Bangalore, India (Gobi Manchoori) [CC BY-SA 2.0 (https://creativecommons.org/licenses/...)], via Wikimedia Commons
By Nithyasrm (Own work) [CC BY-SA 4.0 (https://creativecommons.org/licenses/...)], via Wikimedia Commons

Комментарии

Информация по комментариям в разработке