1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Masteriza [31]
2 years ago
8

What can a method do with a checked exception? Check the exception or ignore it. Return the exception to the sender or handle it

in a catch block. Throw the exception to the method that called this method, or handle the exception in a catch block. Handle the exception in the try block or handle the exception in the catch block.
Computers and Technology
2 answers:
Serggg [28]2 years ago
8 0

Answer:

Handle the exception in a catch block or throw the exception to the method that called this method.

Explanation:

The try and catch statements occur in pairs. The try statement allows the user to define a block of code to be tested for errors while it is being executed.

The catch statement allows the user to define a block of code to be executed, if an error occurs in the try block.

If an exception is checked by a method, the method either handles the exception in a catch block or throw the exception to the method calling it.

Aneli [31]2 years ago
6 0

Answer:

Throw the exception to the method that called this method, or handle the exception in a catch block.

Explanation:

First let us understand what an exception is. A program is a set of instructions and it is executed in a flow which is called flow of program which an exception can interrupt. This exception is basically an unexpected event. Exception can be checked (which is compile time exception) or unchecked (run time exception).  When the exception object is created to indicate the type of error occurred which interrupted the program flow this exception is thrown which indicates that an unexpected event or error has occurred in a program.  

So when a exception is thrown one of two ways are used to deal with it

  • Handle the exception in a catch block,
  • Throw the exception to the method that called this method. It usually has a throw clause which defines what exceptions a method can handle and what not.

Exceptions are handles using try catch block. In this block there are two keywords which are used i.e. try and the other one is catch.

try basically defines a block of code. This block of code is executed and is checked for exceptions.

Now if the exception occurs, catch statement is used to handle this exception. So the catch part is executed when an exception occurs. However if catch statement fails to process this exception then this is thrown to the caller method.

A very common example is of a checked exception FileNotFoundException.

This error occurs when a program wants to read a file. So we get a compiler time exception to handle for situations in which the file does not exist in the location.

So this checked exception is handles either by the catch block or by throwing this exception to the method that called this method.

In catch block we can determine how to handle if the file is not found. If catch block is unable to handle this exception then we will use throw clause. So whenever this exception occurs the methods can throw the IOException and FileNotFoundException is basically a subclass of this. For example in JAVA, java.io.IOException is used for handling such exceptions.

You might be interested in
What are the primary functions of motor oil? a. Reduce friction and prevent wear b. Keep engine surfaces clean c. Remove heat to
ryzh [129]

The answer is E: all of the above.

7 0
3 years ago
What is a quick way to determine if a site might contain reliable information?
xz_007 [3.2K]
<span>The best and most correct answer among the choices provided by the question is the fourth choice.

A way of determining that a site is realiable is examining comments about the <span>webpage.</span></span><span>
I hope my answer has come to your help. God bless and have a nice day ahead!</span>
5 0
2 years ago
Read 2 more answers
What should you install in a server room that will save space by allowing you to control multiple servers with a single mouse, k
Nata [24]

Answer:

a KVM switch

Explanation:

KVM switch is devise used for handling or connecting different server at any time by using single mouse, monitor and keyboard. it is like an interface used to connect different server at any given time.

different type of KVM switch are

1) USB based KVm

2) Emulated USB type KVM

3) DDM USB type KVM

4) semi -DDM KVM

7 0
3 years ago
What is the difference between the Paste Special and Paste Link options?
kotegsom [21]
Paste Link lets you automatically update the referenced document.
8 0
3 years ago
Read 2 more answers
When you code a column list in an INSERT statement, you can omit columns with default values and columns that allow ____________
stiks02 [169]

Answer:

NULL is the correct answer of this question.

Explanation:

The insert statement is used for inserting a column list into the database this statement is an under Data Manipulation language.When we insert any column into the database there is always a null value stored.

  • Insert statement is used to insert the data into the database .
  • To insert data following syntax is used:-

         insert into tablename (column data type).

  • When we insert any data into the database the default value is stored is bull.
6 0
3 years ago
Other questions:
  • Technology has changed the way functions are performed in the law office. Which function has been the least affected by technolo
    10·1 answer
  • One of the most studied computational problems is the ordering of a collection of values. Ordering is important because many pro
    15·1 answer
  • In a "block" containment strategy, in which the attacker's path into the environment is disrupted, you should use the most preci
    15·1 answer
  • In which phase of website design does the designer create a mock-up aimed at the target use
    15·1 answer
  • When would you insert a merge field?
    10·2 answers
  • . Write a C++ Code to get a multiline statement Str1 from a user with a ‘$’ as return character (Hint:
    6·1 answer
  • Computer science - algorithms - flowcharts
    11·1 answer
  • Identify five type of application software​
    12·2 answers
  • Can someone please help me with this ,it is my assignment of technology and agriculture year 8
    5·1 answer
  • Explain the correct ways of using keyboard. .​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!