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
A school has an intranet for the staff and students to use. Some of the files stored on the intranet are confidential. Give two
lapo4ka [179]

Answer:

explanation below

Explanation:

An intranet could be defined as a computer network that is used for sharing information, operational systems, collaboration tools and other computing tasks within a company or organization such as schools. It is usually structured to exclude excess by those outside of the organization.  

Intranet provides a lot of benefits to organization where it is been used and they are as seen below :

1. Users can effectively update and view their documents with ease – scheduling meetings, managing of classroom curriculum and preparing of projects can be done with less stress.

2. It can be used to keep accurate staff records – employees can have their details rightly stored using the intranet and a photograph can also be used.  

5 0
2 years ago
To what type of user does he most likely have access? Jae is using a computer at the public library to do research she's able to
lapo4ka [179]

Answer:

can update her computer by restaring or using an app called:pogram.downloader..com

7 0
3 years ago
Management information system by different outhors<br>​
morpeh [17]

Answer:

Explanation:

.....

...,....

8 0
2 years ago
PLEASE HELP WITH MY COMPUTER
qaws [65]

Answer:

try powering it off the turn it back on

Explanation:

5 0
3 years ago
Read 2 more answers
How do i work on code with someone else? i use visual studio code. me and a friend wanna make a game together with code. how do
Art [367]

Answer:

You can use Repl.it.com......It's best for practising coding languages...

7 0
2 years ago
Other questions:
  • Your friend is working on fixing their Homework assignment. They need a lot of help. You know all the bugs in the file, but due
    12·1 answer
  • The "Rudolph Rule" is best described by which of the following?
    9·1 answer
  • Without entering into the internet cloud or intranet cloud, how many icons in the topology represent endpoint devices (only one
    6·1 answer
  • _______ tools enable people to connect and exchange ideas.
    7·2 answers
  • In the Advent of computer technologies and it's applications, to what extent these technologies have influenced the world.
    11·1 answer
  • Which of the following is a common financial aid scam that students sometimes find on the Internet? Grant and scholarship databa
    8·2 answers
  • Write a program to accept 10 different whole number from the user and store them in a
    11·1 answer
  • Hy plzz help me friends​
    5·2 answers
  • Write a program using for loop to find the cube of numbers from 50-100 <br> FASTT
    11·1 answer
  • You have been supporting CSM Tech Publishing's Windows Server 2016 server network for over a year. The office has two Windows Se
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!