Explain about throw keyword?

Answer Posted / vibhor shukla

throw is used to throw an exception from any part of the
program not necessarily the method only.

whereas throws is particularly used to throw an exception
arising out of the use of a method to the exception handler
which is the catch block..

Is This Answer Correct ?    15 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does addressof operator do in background ?

588


How many types of constructors are there?

510


Why would you use a class property in c#?

507


Can we create extension method for interface?

494


What is a console in c#?

486






What is generic method in c#?

493


What is the difference between int.parse and int.tryparse methods?

566


Define an array?

530


What is difference between === and ==?

468


Is versioning applicable to private assemblies?

570


Which sorting algorithm is best?

558


What are jump statements in c#?

503


What is the default value of decimal in c#?

494


What is an escape sequence? Name some string escape sequences in c#.

518


What is lock statement in C#?

552