answersLogoWhite

0


Best Answer

an IOException is any unexpected problem the compiler encounters while attempting to run a program. Possible problems the compiler may encounter are attempting to read from a file that does not exist, write to a file which has an invalid name (a slash or a question mark in the title should do it), or attempting to read the next token in a file when there are no more tokens.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

When something throws an IOException, it means that whatever is throwing the exception (perhaps a try{}catch block that reads data from a file) can throw an IOException, for example if the file is not found, corrupted, etc, or when the file is otherwise unable to be read, or any other of a list of issues that can occur with the IO package and it's extensions.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

The "throws exception" clause in a method is used to indicate that a function may throw an exception during its execution. This is necessary if one of two conditions exist: 1) the exception might be generated by calling some method within this method that would throw an IOException (notably input/output stream methods), or 2) the method might throw a new IOException as a result of unusual processing conditions that make further execution impossible. A method that does not directly handle an exception will throw this exception to its calling method, which must then either handle the exception or pass it to its calling method, and so on up the execution stack. Exceptions which are thrown up past the top of the execution stack cause a stack trace to be printed and the program to cease execution.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the use of throws io exception in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is difference between exception and error in java and explain using a program?

Error occurs at runtime and cannot be recovered, Outofmemory is one such example. Exceptions on the other hand are due conditions which the application encounters, that can be recovered such as FileNotFound exception or IO exceptions


What are IO Streams in JAVA?

IO streams are usually binary output or input of a file. It is particularly useful to store information in small files. It also allows Serializable objects to be written on the files. But it is usually not a good choice to store Strings or numbers in a stream since it is hard to read from a stream and convert back to the original data type.


What is the use of import in java?

First, it's an error; it should be import java.util.*; That will make all classes in the java.util package availabe for use in your Java class definition. Java is divided up into packages. Each package can hold classes and other packages. java.util is a package.


Why we use io packages in multilevel inheritance?

Multilevel InheritanceA Scenario where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior from yet another class.Ex: public class Automobile {…}Public class Car extends Automobile {…}Public class Ferrari extends Car {…}This multilevel inheritance actually has no limitations on the number of levels it can go. So as far as java goes, it is limitless. But for maintenance and ease of use sakes it is better to keep the inheritance levels to a single digit number.A point to note here is that - using io packages is not mandatory. You need to use them only if you want to have some i/o operations in your code.


What did IO Carter invent?

Nursery Chair .

Related questions

What is difference between exception and error in java and explain using a program?

Error occurs at runtime and cannot be recovered, Outofmemory is one such example. Exceptions on the other hand are due conditions which the application encounters, that can be recovered such as FileNotFound exception or IO exceptions


What is 'I am American' when translated from English to Italian?

Io sono Americano it is not necessary to use the personal pronoun for I which is io. Sono Americano is sufficient. The verb form sono implies I or io and using io is considered redundant or non native by Italians.


What is IO mapped?

Peripheral-Mapped IO is IO that is selected when the IO/M- line is high.


What are io devices?

list three Apple devices that use the iOS.


What does io mean in English?

If you are referring to the Italian word 'Io' which can be used in the sentence 'Io Sono', Io means I. Io sono means I am.


What is Peripheral-Mapped IO?

Peripheral-Mapped IO is IO that is selected when the IO/M- line is high.


Differentiate between memory mapped IO and IO mapped IO?

Memory mapped IO is one where the processor and the IO device share the same memory location(memory) while IO mapped IO is one where the processor and the IO device have different memory located to each other.


What are IO Streams in JAVA?

IO streams are usually binary output or input of a file. It is particularly useful to store information in small files. It also allows Serializable objects to be written on the files. But it is usually not a good choice to store Strings or numbers in a stream since it is hard to read from a stream and convert back to the original data type.


What places were named after europa and io?

Io and Europa are two of the 63 (known) moons of Jupiter. In Greek mythology, Io was a priestess of Hera and Europa was the queen of Crete; both were lovers of Zeus, whose Roman name was Jupiter. The continent of Europe is also named for Europa; the term has been in use since at least the 1st century CE (AD). The asteroid 85 Io is also named for Io.


What is the use of import in java?

First, it's an error; it should be import java.util.*; That will make all classes in the java.util package availabe for use in your Java class definition. Java is divided up into packages. Each package can hold classes and other packages. java.util is a package.


Which of 'Io ho diciasettenne' or 'Io sono dicisettenne' is correct Italian?

When talking about age in Italian language you have 2 choices; 1. You use the verb "to have" or "avere" and say - "Io ho diciasette anni". That is the most common way of expressing age. 2. You use the verb "to be" or "essere" and say "Io sono diciasettenne". "Diciasettenne" means seventeen-year-old, so obviously we want to say "I am seventeen-year-old".


What is the Difference between memory mapped IO and peripheral mapped IO?

A memory mapped IO device is an IO device that responds to a specific address when IO/M- is low. A peripheral (or IO) mapped IO device is an IO device that responds to a specific address when IO/M- is high.Many system designers ignore IO/M- in favor of memory mapped IO.This eliminates one term in the chip select logic for every device.This allows you to use all addressing modes and instructions when manipulating an IO device, as opposed to using only IN and OUT.This allows you to potentially have more than 256 different IO devices.The downside is that you reduce the addressable main memory in the system, i.e. you cannot have all 64K available to you, but this is not generally a problem in most controller designs. You also must decode 16 address lines instead of just 8 when accessing the device.