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
-Dominant- [34]
3 years ago
11

The 'parseInt' method of the 'Integer' class throws a 'NumberFormatException' when it is passed a String argument that it cannot

convert to an int. Given the String variable s (which has already been assigned a value), write the code needed to convert the value in s assigning the result to the integer variable i If a NumberFormatException is thrown, i should be assigned the value -1.
Computers and Technology
1 answer:
vekshin13 years ago
3 0

Answer:

Following are the code in the java language  

try // try block

{

i = Integer.parseInt(s); // converting into the integer  

}  

catch (NumberFormatException e) // catch block

{

i = -1; // initialized i to -1.

}

Explanation:

Following is the description of code.

  • Create a try block in that clock we convert the variable "s" into the integer by using the function  Integer.parseInt and storing in the variable "i".
  • if try block gives an error the console is directly going  in the second we create a catch block for that try block In this block we initialized the variable  i to -1.
You might be interested in
What should you do before cleaning the top of a storage battery and rinsing it with fresh water?
Montano1993 [528]
D. Discharge the battery completely
6 0
3 years ago
Compound conditions require a computer to sense whether multiple conditions are true or false.
Anna71 [15]

Answer:

False

Explanation:

You can have multiple conditions in your while and for loops as well as your if statements.

4 0
3 years ago
One of the most notable impacts of IT on business is improved
Igoryamba

One of the most notable impacts of IT on business is improved efficiency  of security communication.

<h3>What is security communication?</h3>

Security Communication Systems are said to be a vital aspect or part of works as well as in security mitigation measure.

The use of security communication in any organization is known to be the use of security tools to be able to keep the organization safe from any form of attack.

Note that One of the most notable impacts of IT on business is improved efficiency  of security communication as it boast security of data.

Learn more about security communication  from

brainly.com/question/25720881

#SPJ1

8 0
2 years ago
Does group policy management matter without a server environment?
eimsori [14]

Answer:

The group policy management is one of the policy which used in the microsoft window that basically control the server working environment in the organization. It mainly control the user account and the personal computer account.

The group policy is the centralized management and the provide the various configuration of the operating system. It also manage and control the users setting in the active directory of the management.

Therefore, the group policy management matter in the server environment.

4 0
4 years ago
Suppose you want to encode the numerals 0–9 and the 26 letters of the alphabet, using separate codes for lowercase and uppercase
labwork [276]

Lets first work out how many different codes would be needed to represent everything. 26 for lowercase, 26 for uppercase, and 10 for 0-9. Total, that makes 62 needed codes.

If we start with 0, we need to go up to 61 to represent all the characters. Thus, we can convert 61 to binary and count the number of digits needed to represent that as the last number in the set and that will tell us how many digits are needed.

61 in binary is 111101, so we need 6 digits to represent that number. The answer is B.

4 0
4 years ago
Other questions:
  • A document repository is down when you attempt to access it. which isa principle is being violated?
    13·1 answer
  • Suggest how the following requirements might be rewritten in a quantitative way. You may use any metrics you like to express the
    7·1 answer
  • In traditional programming, probably the most often used error-handling outcome was to ____.
    15·1 answer
  • what is the first step you would take when troubleshooting an external network, such as an internet connection issue?
    13·2 answers
  • What is the full form of PDP​
    7·1 answer
  • Light travels at 3 × 108 meters per second. A light-year is the distance a light beam travels in one year.Write a PYTHON program
    14·1 answer
  • What information may be obtained from a ResultSetMetaData object?(TCOs 1–6) What information may be obtained from a ResultSetMet
    9·1 answer
  • You dad has given you his old digital scanner for your new computer. you plug it into the usb drive on your windows 8 computer b
    8·1 answer
  • What are the two types of commennts of java​
    12·1 answer
  • Which option in PowerPoint allows users to configure the number of columns and rows manually, using numerical values?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!