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
Damm [24]
3 years ago
10

What is the difference between the throw statement and the throws clause?

Computers and Technology
1 answer:
ruslelena [56]3 years ago
6 0

Answer:

throw and throws represent different constructs in Java programming language.

Explanation:

throw is used to explicitly throw an Exception from within a code segment.

For example:

public void throw_test(String str){

        if(str==null) throw new NullPointerException();

}

throws is used to specify an exception list which may be thrown by a method:

For example:

public String readFromFile(File f) throws IOException {

.....

// Some code fragment which could throw a IOException

}

You might be interested in
You are the manager and an employee shows up for his shift dressed inappropriately for work. What should you do?
yarga [219]

Most managers see inappropriate dressing every day. Some are left angered while some are confused as to what is the right way to approach such situations. What follows next needs to be professional oriented. Being the manager, I would start by finding out what the appropriate dressing policies are. Some companies might have dress code policies while others might not. Assuming that this company has, I would read these policies carefully. The next thing that is required from me is to have a small conversation with the employee discretely. As professional as I can be, I will mention how I feel his or her dress code is inappropriate and try to summon the employee by asking him or her whether they are fully aware of the appropriate dress code. I will try to agree with the employee on what is appropriate and what is not. If we agree, requesting the employee to home and change clothes is unnecessary, but if the need to do that arises, I would consider that to be an option.

7 0
2 years ago
Read 2 more answers
¿Toda sustancia de aspecto homogéneo es siempre una sustancia pura?
Gwar [14]

Answer:

No, las sustancias homogéneas pueden ser mezclas.

8 0
2 years ago
The excessive use of the internet and the web for personal use at work is sometimes called ____ .
Elodia [21]
This is called Cyberslacking
7 0
3 years ago
Read 2 more answers
Which features must you remove from a full gui installation of windows server 2012 r2 to convert it to a server core installatio
jok3333 [9.3K]

Graphical management tools and infrastructure, Server graphical shell
5 0
2 years ago
I need ideas for a scratch (imagine, share, and program) coding project. You can think of any project you'd like thanks! :)
alex41 [277]

You did not include enough information.

5 0
3 years ago
Read 2 more answers
Other questions:
  • All spreadsheet formula should start with
    12·1 answer
  • What is the target audience for this poster?
    5·2 answers
  • In Modern operating system, the __ feature has dramatically improved user productivity.
    11·1 answer
  • What is an example of a hard skill?
    12·2 answers
  • You are given the task of reading in n numbers and then printing them out in sorted order. Suppose you have access to a balanced
    12·1 answer
  • How do you award a brainliest
    8·2 answers
  • . ------------ means that the two merging companiesbecame history and a new firm
    10·1 answer
  • Pls help me!!!!!!!!!!!!!!!!!!!
    11·2 answers
  • When you sign in to your Microsoft account with another Windows device, your settings will appear very differently than they do
    7·1 answer
  • Defination of formula bar​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!