answersLogoWhite

0


Best Answer

we use throws in our program so that we dont need to write try & catch block & to avoid the exception

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why use throw in java in compare try-catch?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why should throw keyword is used in java?

Use it when you are implementing something that says it throws a certain exception when a certain condition is met.


What is anonymous object in java?

Objects without their declarations known as Anonymous Objects. these are known as use & throw objects because these are died after one time use.


Can you use pointers in java?

Java does not support Pointers and hence you cannot use it in Java.


When should we use exception handling in java?

Exception handling should be used in Java in all cases where you as a programmer suspect that your code might throw some exceptions or create errors that might look ugly when a user is using the application. In such cases you use exception handling to catch and handle the exception and exit gracefully. You use the try - catch block in Java for exception handling.


What technologies link to Java?

Java is exclusive to surfing the web. Some web sites use Java to embed videos, others use Java for advertisements.


Does Java Script use the same compiler as Java?

No


What you use in case of pointer in java?

Java does not have pointers


What is java 7?

Java 7 is the most current version of Java. Many movies and games use Java.


Which is the best Book to understand JAVA in short?

You can use Head First Java or Java Complete Reference to learn Java.


Do you have to use java?

Not usually. There are numerous languages out there with similar functionality. The only time you must use Java is if your employer or client demands that a project be done in Java, or a particular platform requires the use of Java, such as Android OS.


How do you script a RuneScape bot?

RuneScape bots use Java. Use a Java Binary Code.


TryCatch statements needed in JavaScript?

try...catch statement are not necessary anywhere. They are basically a fail-safe measure which ensures if a function does not execute an error is caught. Good programmers will always use try...catch so they realise if function executed or not