UrbanPro

Learn Java Training from the Best Tutors

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

Search in

What is the difference between checked and unchecked exceptions?

Asked by Last Modified  

15 Answers

Learn Java

Follow 1
Answer

Please enter your answer

Professional Tutor with 15 years of experience.

The main difference between checked and unchecked exception is that the checked exceptions are checked at compile-time while unchecked exceptions are checked at runtime
Comments

Certified Hadoop Developer with Spark Expertise

checked exception has been thrown at the time of compilation, we can handle in two ways we can handle this by try catch block or we can throw this exception. Un checked exceptions are the exceptions thrown at the time of run time, we can handle this by using try and catch blocks.
Comments

Software Engineer with 15 years of Professional experience in MNCs (JP Morgan, TCS, Mastek)

A checked exception must either be handled within a catch block or declared with a throws clause in the method declaration. If not, the compiler will throw an error. There are no such restrictions with unchecked exceptions.
Comments

Software Engineer with 15 years of Professional experience in MNCs (JP Morgan, TCS, Mastek)

A checked exception usually occurs out of an exceptional situation that your application should reasonably try to recover from. For example, on catching a FileNotFoundException your program could prompt the user for the correct file path again. An unchecked exception usually occurs because of a bug...
read more
A checked exception usually occurs out of an exceptional situation that your application should reasonably try to recover from. For example, on catching a FileNotFoundException your program could prompt the user for the correct file path again. An unchecked exception usually occurs because of a bug in your application. Hence, instead of catching the exception, you fix the underlying logic of your program. For example, if you incorrectly access an array at an index that lies outside its size, an IndexOutOfBoundsException is thrown. read less
Comments

Java Tutor

Checked exception are the subclass of Exception except RuntimeException . The code which can throw these exception must be either put in Try Catch block or declare Throws in method signature. It is checked during compile time Unchecked exception are exception which generate at runtime,
Comments

Senior Software Engineer

Checked Exception in Java is all those Exception which requires being catches and handled during compile time. If Compiler doesn’t see try or catch block handling a Checked Exception, it throws Compilation error. Now Which Exception is checked Exception and Why Checked Exception are introduced in first...
read more
Checked Exception in Java is all those Exception which requires being catches and handled during compile time. If Compiler doesn’t see try or catch block handling a Checked Exception, it throws Compilation error. Now Which Exception is checked Exception and Why Checked Exception are introduced in first place? All the Exception which are direct sub Class of Exception but not inherit RuntimeException are Checked Exception. read less
Comments

Trainer

There are two types of exceptions: checked exceptions and unchecked exceptions. The main difference between checked and unchecked exception is that the checked exceptions are checked at compile-time while unchecked exceptions are checked at runtime.
Comments

More than 12 years of experience in IT Industry including Science/Computer teaching

1) Checked Exception The classes that extend Throwable class except RuntimeException and Error are known as checked exceptions e.g.IOException, SQLException etc. Checked exceptions are checked at compile-time. 2) Unchecked Exception The classes that extend RuntimeException are known as unchecked...
read more
1) Checked Exception The classes that extend Throwable class except RuntimeException and Error are known as checked exceptions e.g.IOException, SQLException etc. Checked exceptions are checked at compile-time. 2) Unchecked Exception The classes that extend RuntimeException are known as unchecked exceptions e.g. ArithmeticException, NullPointerException, ArrayIndexOutOfBoundsException etc. Unchecked exceptions are not checked at compile-time rather they are checked at runtime. read less
Comments

Principal Software Engr with good JAVA, J2EE, SQL skills

Checked Exceptions - compiler can predict when/where the exception is going to be thrown in the code. Ex: FileNotFoundException. UnChecked Exceptions - compiler can NOT predict when/where the exception is going to be thrown in the code. Ex: NullPointerException
Comments

Software Development Trainer

Checked exceptions are checked at compile time. Like if you are trying to read a file, then there are chances of getting an exception. So compiler forces use to use either try...catch block or use throws(at function level). But unchecked exceptions are which ain't checked for at compile time. Like...
read more
Checked exceptions are checked at compile time. Like if you are trying to read a file, then there are chances of getting an exception. So compiler forces use to use either try...catch block or use throws(at function level). But unchecked exceptions are which ain't checked for at compile time. Like in case you are dividing a number via another. There are chances of getting divide by zero exception but compiler doesn't force you to use try...catch or throws. read less
Comments

View 13 more Answers

Related Questions

How many years of experience should a good Java trainer need?
Minimum 4 years, actually it depends how much exposure you got and how you worked in project(s)
Nayan
0 0
5
What are the differences between Class Methods and Instance Methods in Java?
Class methods are static methods in java. The method can be called without creating an instance of the class.For e.g, main method is declared static that is why we are able to call main method without...
Neval
0 0
5
How do I show a popup message over a system tray icon/application in Java?
The java.awt.SystemTray class introduced in Java™ SE version 6 represents the system tray for a desktop. The system tray can be accessed by calling the static SystemTray.getSystemTray() method. Before...
Ajith
0 0
5
Can you tell me some new features in JavaFX 2.0?
JavaFX is a software platform for creating and delivering desktop applications, as well as rich internet applications (RIAs) that can run across a wide variety of devices. JavaFX is intended to replace...
Renuka
0 0
5

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

Ask a Question

Related Lessons

Importance of Constructor's Visibility.
While developing program or implementing Singleton pattern we have learnt to mention constructor as private and known reason is -> to blocked its direct call from outside of class. But did we think...
M


How can everyone prepare to clear any Java interview?
Java interview your java should be much strong then J2EE. core java and Advance java is the basic foundation for Interview. Some of the topic about which you should know before going for a java interview...

Java Interview Questions & Answers
Java Interview Questions have been designed especially to get you acquainted with the nature of questions you may encounter during your interview for the subject of Java Programming Language. As per my...

Advance Java
1) Servlet • Basics of Servlet • Servlet Request • Servlet Collaboration • Servlet Config • Servlet Context • Attribute • Session Tracking • Event and Listener •...
A

Recommended Articles

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 >

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 >

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

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