UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Why is finally introduced in Java?

Asked by Last Modified  

21 Answers

Learn Java

Follow 0
Answer

Please enter your answer

Java Trainer

Finally is introduced in Java to do the code clean up or if you wants to perform some operation irrespective of whether the code throws an Exception or not.
Comments

Tutor

The finally block always executes, even if exceptions are not there. So, if you forget to write a requisite try or you want your program to end in a specified way, finally comes to play.
Comments

Java Trainer

end of the code executed.
Comments

Assuming that you mean "finally" that comes after try block: "finally" block is great place to free up resources, like DB connection, File etc. Finally is executed regardless of whether an exception occurs or not. Putting cleanup code in a finally block is always a good practice, even when no exceptions...
read more
Assuming that you mean "finally" that comes after try block: "finally" block is great place to free up resources, like DB connection, File etc. Finally is executed regardless of whether an exception occurs or not. Putting cleanup code in a finally block is always a good practice, even when no exceptions are anticipated. read less
Comments

Java Trainer with 6+ years of experience in big MNCs

finally is introduced to perform the cleanup operations such as closing the open DB connection clearing up the resources etc.
Comments

Java Web Application Development and Aptitude Trainer

Finally block helps you specify a block of code which you would want executed no matter if an exception arises or not.
Comments

Finally creates a block of code that will be executed after a try/catch block has completed and before the code following the try/catch block. The finally block will execute whether or not an exception is thrown. If an exception is thrown, the finally block will execute even if no catch statement matches...
read more
Finally creates a block of code that will be executed after a try/catch block has completed and before the code following the try/catch block. The finally block will execute whether or not an exception is thrown. If an exception is thrown, the finally block will execute even if no catch statement matches the exception. Besides exception handling, finally is also used in file closing and freeing up any other resources, when a method is about to return to the caller from inside try/catch block through a return statement and finally clause is executed just before methods returns. read less
Comments

Professional with 11 years of Java/J2EE SW development Industry experience.

Finally block in Java exception handling is a mechanism to write some clean-up activity code. Since 'finally' block code always executes it gives the programmer to do the clean-up activity even if the code in try block results in an unexpected exception. Also the finally code cannot be bypassed with...
read more
Finally block in Java exception handling is a mechanism to write some clean-up activity code. Since 'finally' block code always executes it gives the programmer to do the clean-up activity even if the code in try block results in an unexpected exception. Also the finally code cannot be bypassed with a 'break, return or continue'. Its a good practice to always include the finally block after try and catch. read less
Comments

Senior Software Engineer

it depends on whether you can deal with the exceptions that can be raised at this point or not. If you can handle the exceptions locally you should, and it is better to handle the error as close to where it is raised as possible. If you can't handle them locally then just having a try / finally block...
read more
it depends on whether you can deal with the exceptions that can be raised at this point or not. If you can handle the exceptions locally you should, and it is better to handle the error as close to where it is raised as possible. If you can't handle them locally then just having a try / finally block is perfectly reasonable - assuming there's some code you need to execute regardless of whether the method succeeded or not. read less
Comments

Senior Software Engineer

t depends on whether you can deal with the exceptions that can be raised at this point or not. If you can handle the exceptions locally you should, and it is better to handle the error as close to where it is raised as possible. If you can't handle them locally then just having a try / finally...
read more
t depends on whether you can deal with the exceptions that can be raised at this point or not. If you can handle the exceptions locally you should, and it is better to handle the error as close to where it is raised as possible. If you can't handle them locally then just having a try / finally block is perfectly reasonable - assuming there's some code you need to execute regardless of whether the method succeeded or not. read less
Comments

View 19 more Answers

Related Questions

What is a complete list of topics of Core Java and topics of Advanced Java?
Core Java covers some topics like data types, OOP, operators, exception handling, swing, threading, and collections. Advanced Java covers some topics like web services, database connectivity, JSP, Servlets, EJB, etc.
Archit
0 0
5
Can finally block be used without try block?
No. But it can be used without a catch block.
Sarala
1.What is Model Driven Interceptors is used for? 2.what is the purpose of using Action support??
Using ActionSupport class, we can implement Custom validation which validates at the server-side. We can write server side validation logic in validate() method.
Monisha
What are the qualities of a good Java trainer?
Good java trainers are always teaching their students with practical examples. This exactly happens in BEE Apprentice, our trainers are working in MNCs hence they are updated with technology and are best trainers.
Venu
0 0
5

Hi every one i have done my I com so plzz suggest me it course. I want do carrer in it field

First of all you should take the degree course with full concept because when you have chosen this subject then you will haveto try for best performance in it
Aquib
0 0
9

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Why We Should Go With Java?
Java is widely used in the Desktop application, web application, mobile development, games etc. Java is an object-oriented programming language. Its follow all the oops concept Like Object, Class,...
B

Bhupendra Patidar

0 0
0

Use of Service Locator Pattern
If we want to reuse the java code that should be the best approach w.r.t re-usability, maintanence and saving time to concentrate on our own businbess logic/requirement. In the similar approach many patterns...
M

GIT
In software engineering, software configuration management (SCM) is the task of tracking and controlling changes in the software, part of the larger cross-disciplinary field of configuration management....
R

Introduction to Course Content
Video about what we are going to learn throughout the Java Training Session .

JAVA OOPs Concepts (Object-Oriented Programming System)
JAVA OOPs Concepts (Object-Oriented Programming System) It is primarily having below crucial points. Without below essential points, we will never be able to achieve OOPs in java, PHP, C#, etc. Now let...

Recommended Articles

Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more