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

Please tell me what Object Oriented Programming and Object Based Programming with reallife example..what is the difference between them.?
Hi Ritesh, In order to be a true object oriented programming language, following 4 need to be present… 1) Abstraction - Hiding the implementation details from the user, only the functionality will...
Ritesh
What are the topics covered under core Java?
The major topics are listed below: 1. Java Basics - Variables, Data types, Operators, Control Statements,Strings, Arrays and Functions. 2. Object Oriented Concepts - Classes, Objects, Constructors, Inheritance,...
Sahil
0 0
6
What's New in JDK 8 ?
1.Lamda Expressions I started with lambda expressions as this is probably the most sought after feature in the language after probably Generics/Annotations in Java 5. 2.Generic Type changes and improvements Taking...
Ashish
What is JavaBean?
All javabeans are pojos ,But not all pojos are not javabeans.
Ankit
0 0
6
Write a programme to replace the string without using replace command? This is my string. ..... s is replaced by th output is Thith ith my thtring
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package logic; ...
Mithun

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

Ask a Question

Related Lessons

A Tip for the beginners.
The world of programming languages right now is too dense, and too big for any beginner. But at the same time, because of so many options available, it's easier too. You can start with any language that...

Core Java
Introduction: An Object Oriented Programming Language consists of Objects. There are object oriented programming languages like Smalltalk, C++. Each and every OOP language has some underlying disadvantages....

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...

Java Achieve (JAR)
Java Archieve is a binary form to bundle a Java library which equivalent to zip file. It contains .class files, .properties, .jpeg, OR any supporting files to execute this library. For Example- junit.jar,...

Class and Objects in Java
Class is a template or a blueprint which is used to describe an object. On other hand Object is a reference of a class which follows all the stuff written inside the class. How about taking the whole tour in the following video

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