OOPs Concepts
Programming and Technical
Logical Reasoning
Cryptography
When should a function throw an exception?
Read Solution (Total 7)
-
- Function should throws an exception when some invalid input is given to it's parameter in run time
- 10 years agoHelpfull: Yes(5) No(0)
- when the function encounter a runtime error, then it throws the exception so that programmer can recognize which function is responsible for that error.
- 10 years agoHelpfull: Yes(3) No(0)
- function throws an exception handling when all the logical and syntax part are correct still there will be some invalid input lyk for example:
int a=1,b=0,c;
c=a/b;
pf("%d",c);
here 1/0=infite so it will throw an error in run time. - 10 years agoHelpfull: Yes(2) No(0)
- logical error can occured then exception will display
- 10 years agoHelpfull: Yes(1) No(3)
- When we have given some condition in try block and if that condition proved when user enter some input at run time, then it throws an exception and statements of the catch block is executed.
- 10 years agoHelpfull: Yes(0) No(0)
- Function should throws an exception when some invalid input is given to it's parameter in run time error
- 10 years agoHelpfull: Yes(0) No(2)
- when an error occurs at run time
- 5 years agoHelpfull: Yes(0) No(0)
OOPs Concepts Other Question