answersLogoWhite

0


Best Answer

There are two ways. The method can have a try catch block and handle the error/exception inside the method. Or The method can throw the exception under the assumption that the calling method would have the code to handle the exception that is thrown by this method

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Describe different ways that a function can handle errors?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is function overloading in c language of computer?

There is no such thing as function overloading in C; that is a feature of C++. Function overloading allows us to provide two or more implementations of the same function. Typically, we use function overloading so that the same function can cater for different types. For instance, we might provide one implementation that is optimised to handle an integer argument while another is optimised to handle a real argument. We can also use function overloading to provide a common implementation of a function which can then be invoked by overloads that handle the low-level type conversions.


What happens if recursion function is declared inline?

An inline function replaces the call to the function by the body of the function, thus reducing the overhead of saving the context in stack. This is good for functions which are small in size and called occasionally. A recursive function calls an instance of itself and thus can be a deeply nested. Different compilers handle this differently. Some will inline it up to a certain depth and then call a non-inlined instance for further recursion; others will not inline the function at all and generate a normal function call.


How does a can crusher work?

Basically you have a frame with a handle and a press. You put the can on the ledge on the frame, then pull the handle down and the press flattens the can. There are different models of can crushers, including some with electric motors to do the crushing.


Which function is used to move file pointer from any position in file in c language?

FILE-level: ftell/fseek, fgetpos/fsetpos handle-level: lseek


What is callback function in c?

In computer programming, a callback is executable code that is passed as an argument to other code. It allows a lower-level software layer to call a function defined in a higher-level layer. Usually, the higher-level code starts by calling a function within the lower-level code passing to it a pointer or handle to another function. While the lower-level function executes, it may call the passed-in function any number of times to perform some subtask. In another scenario, the lower-level function registers the passed-in function as a handler that is to be called asynchronously by the lower-level at a later time in reaction to something. A callback can be used as a simpler alternative to polymorphism and generic programming, in that the exact behavior of a function can be dynamically determined by passing different (yet compatible) function pointers or handles to the lower-level function. This can be a very powerful technique for code reuse. Callback functions separate the caller from the callee, the caller doesn't care who the callee is For complete understanding we need to know about Function pointers in c. check the link below

Related questions

How would you describe your manager's preferences?

The best answer to this question would be............. I would describe my style of management as situational. I manage according to the situation at hand, because not every situation is the same. This response indicates that you, not only have the ability to handle different situations, but you can handle all situations as they are presented. Give examples of different situations and how you would handle them


How would you describe your preferred management style?

The best answer to this question would be............. I would describe my style of management as situational. I manage according to the situation at hand, because not every situation is the same. This response indicates that you, not only have the ability to handle different situations, but you can handle all situations as they are presented. Give examples of different situations and how you would handle them


How computer handle semantic error?

Semantic error are logical errors. That does mean, it would compile and run without errors. But, the output would be different from the expected output.


What is function overloading in c language of computer?

There is no such thing as function overloading in C; that is a feature of C++. Function overloading allows us to provide two or more implementations of the same function. Typically, we use function overloading so that the same function can cater for different types. For instance, we might provide one implementation that is optimised to handle an integer argument while another is optimised to handle a real argument. We can also use function overloading to provide a common implementation of a function which can then be invoked by overloads that handle the low-level type conversions.


How would you describe a door?

A door is a piece of rectangle wood with a handle that leads into different rooms when pushed or pulled and varies in colour.


What is the function of handle bars?

They are used to steer.


What is the function of the handle of microscope?

To lift it by when moving it.


What is the function of the mug?

A mug is a drinking vessel with a handle


What is the function of handle in sewing machine?

guides the thread??


What is the function of the handle in claw hammer?

The handle is the lever which allows you to pull nails or pound a nail with equal ease.


What is function in Java Script?

function in the scripting language can give an attribute to something to make it preform a task that you want it to handle.


What types of pet reptiles can you handle?

you can handle all lizards, but different kinds like to be handled different ways.size matters too!