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

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

Ask a Question

Related Lessons

How to create Rest web services in Java
Web services are web application components that lets two different applications to communicate over the network.Let if an application which in written java provides web services can be communicated through...

How to create excel sheets using Java?
HSSFWorkbook workbook = new HSSFWorkbook();HSSFSheet sheet1 = workbook.createSheet("actions");for (int i = 0; i < 10; i++) { sheet1.createRow(i); for (int j = 0; j < 10; j++) { HSSFRow currRow =...

Java: A Quick Overview
Not purely Object Oriented: It doesn't support multiple inheritence, it supports primitive data types and static members. Doesn’t support multiple inheritance: Reason is diamond problem i.e.,...

Access Specifiers â?? Private, Protected, Public, Package-private
Access level modifiers determine whether other classes can use a particular field or invoke a particular method. The following table shows the access to members permitted by each modifier. Access...

Priority in TestNG
public class Priority { @Test (priority=1)public void login() {System.out.println("login");} @Testpublic void email1() {System.out.println("email1");} @Test (priority=-2)public void email2() {System.out.println("email2");} //I...
S

Sarthak C.

0 0
0

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