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
If i were to give you free points woulld you take them?
kipiarov [429]

Answer:

D) friend me

Explanation:

6 0
3 years ago
Read 2 more answers
FREE 10 POINTS THE EASIEST QUESTION EVER I AM NEW SO I DONT KNOW HOW TO MARK SOMEONE THE BRAINLEAST ????????????????????????????
umka2103 [35]

Usually you can just report the question as useless or just report in in general. But I myself have read some answers and they dont even pertain to the question, it confuses me alot

8 0
3 years ago
Read 2 more answers
____ convert a program design developed by a systems analyst or software developer using one of many computer languages.
erica [24]

Answer:

"Programmer " is the correct answer for the following question.

Explanation:

A programmer is a person who created the software They are basically a coder who develop a code for the program or the software. They are specialists in some in the programming code area. The programmer are writing the program for a different kind of software.

The main objective programmer they convert the program design which is developed  by a systems analyst or system designer using a different kind of computer language  

4 0
3 years ago
Flodding on rivers is caused by human activity rather than natural events true or false
ValentinkaMS [17]

Answer:

True

Explanation:

While I believe it's a compendium of the both(both true and false), I when asked to pick just one, I would go with yes. They're are lots of things we humans do on a general note that causes flooding. Although, heavy rainfall can also cause flooding and that's not as a result of human activity, but directly. But then, activities like not maintaining a dam, or erecting a structurally failed dam can cause flood to occur at any point in time, without warning even. Another way is when due to our activities, we block the rivers, this can also lead to flooding exactly like the case of heavy rainfall does. Lack of good drainage facilities, drainage wouldn't create itself, we as humans do. When we don't were essentially creating an excuse for an eventual happening of flood.

Succinctly put, human activities also cause floods, as much as natural events causes flood.

3 0
2 years ago
PLS HELP
kvasek [131]

Answer:

informative, discrimiitive,critical thats the order

4 0
2 years ago
Other questions:
  • ACCOUNTING
    13·2 answers
  • SOMEONE PLEASE HELP ASAP!!
    14·2 answers
  • How do you insert a new row into a worksheet
    5·1 answer
  • Q) CITY column of a table contains information such as Bangalore , Bangalore-64 , Bangalore-56001 , Mumbai - 400002 etc in order
    8·1 answer
  • #Write a function called alter_list. alter_list should have#two parameters: a list of strings and a list of integers.##The list
    11·1 answer
  • NEED HELP RIGHT NOW!!! Which of the following is the definition of a privacy policy? * 5 points - A legal document that an app o
    6·1 answer
  • Please help!!! I am very confused about this question!
    10·1 answer
  • WHAT TYPES OF ACTIVITIES ARE PERFORMED BY HEALTH CARE SOFTWARES
    8·1 answer
  • when two people are in a race, what do you need to know to determine who is the fastest 1 units of speed that are identical 2 th
    10·1 answer
  • Vẽ sơ đồ DFD cho của hàng bán điện thoại ( Môn phân tích và thiết kế hệ thống thông tin)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!