05 November 2020

#ExceptionHandling

#Exception_Handling
What is an exception in Java?
What is the difference between Error and Exception?
What is the difference between checked and unchecked exceptions?
Can you catch Error in a catch block? Should you?
What are the common unchecked exceptions in Java?
What happens if an exception is not caught?
What is the difference between throw and throws?
Can a finally block be skipped?
What is the use of the finally block in Java?
What is the difference between final, finally, and finalize()?
What is exception propagation in Java?
Can a catch block exist without a try block?
Can we have multiple catch blocks for a single try block?
What will happen if both try and finally blocks throw an exception?
What is the order of execution of try-catch-finally blocks?
Can we use multiple exceptions in a single catch block (multi-catch)?
What is try-with-resources? How is it different from finally?
What is a suppressed exception? How can we retrieve it?
Why is it not recommended to catch Exception or Throwable directly?
How do you create a custom exception in Java?
What is exception chaining in Java?
What are checked exceptions, and why are they controversial?
How do you handle exceptions in Java 8 functional programming (e.g., in lambdas)?
What is the role of getCause() and initCause() in exceptions?
How does the JVM handle uncaught exceptions?
What is the performance cost of using exceptions?
What is the difference between RuntimeException and other exceptions?
How does exception handling work in Spring Boot (e.g., @ControllerAdvice)?
How do logging and exception handling work together in a production environment?
Write a method that throws a custom checked exception.
Write code to wrap a SQLException inside a custom exception.
Fix a code snippet where exception is being swallowed silently.
What happens if you return from the finally block?
What effect does it have on exceptions thrown in try or catch?
Can finally block override the value returned from a try or catch block?
Can we throw an exception from the finally block?
What are the consequences?
What is the impact of exception handling on performance in tight loops?
How does exception handling work with multithreading?
What happens if a thread throws an uncaught exception?
How do you handle exceptions globally in Java SE applications?
What is Thread.setDefaultUncaughtExceptionHandler()?
What is the difference between ExceptionInInitializerError and NoClassDefFoundError?
Can constructors throw exceptions? How do you handle them?
Why is it bad to catch and ignore exceptions silently?
What is the IllegalStateException and when should it be used?
How does Spring handle exceptions in REST controllers?
What is the role of @ResponseStatus in exception handling?
What is DataAccessException in Spring, and why is it unchecked?
How does exception translation work in Spring Data JPA (PersistenceExceptionTranslator)?
How can you configure a global exception handler in a Spring Boot microservice?
How do you test that an exception is thrown in JUnit 4 vs JUnit 5?
When should you create a new custom exception class vs reuse an existing one?
Why is it better to log the entire stack trace instead of just the exception message?
How do you ensure meaningful exception messages in production systems?
What is the difference between IllegalArgumentException and IllegalStateException?
How do you deal with exception wrapping and unwrapping in large systems?
What is a fail-fast system and how do exceptions play a role in that?
How would you handle exceptions in batch processing (e.g., Spring Batch)?
How can exceptions lead to memory leaks if not handled properly?
What is an Exception in Java?
What are the Exception Handling Keywords in Java?
Explain Java Exception Hierarchy?
What are the important methods of Java Exception Class?
Explain Java 7 ARM Feature and multi-catch block?
What is the difference between Checked and Unchecked Exceptions in Java?
What is the difference between the throw and throws keyword in Java?
How to write custom exceptions in Java?
What are different scenarios causing ?Exception in thread main??
What is the difference between final, finally, and finalize in Java?
What happens when an exception is thrown by the main method?
Can we have an empty catch block?
What is NullPointerException?
What is ArrayIndexOutOfBoundsException?
What is NumberFormatException?
How the exceptions are handled in java? OR Explain exception handling mechanism in java?
What is try block?
What is catch block?
What is finally block?
What is an exception?
What is the difference between error and exception in java?
What is unreachable catch block error?
What are run time exceptions in java. Give example?
What is OutOfMemoryError in java?
what are checked and unchecked exceptions in java?
What is the difference between ClassNotFoundException and NoClassDefFoundError in java?
What is Re-throwing an exception in java?
What is the use of throws keyword in java?
What is the difference between final, finally and finalize in java?
What is ClassCastException in java?
What is the difference between throw, throws and throwable in java?
What is StackOverflowError in java?
What are chained exceptions in java?
What are the legal combinations of try, catch and finally blocks?
What is the use of printStackTrace() method?
What is ClassNotFoundException?
What is SQLException?
What is IOException
Explain the hierarchy of exceptions in java?
Why it is always recommended that clean up operations like closing the DB resources to keep inside a finally block?
Which class is the super class for all types of errors and exceptions in java?
How the exceptions are handled in java? OR Explain exception handling mechanism in java?
How do you create customized exceptions in java?
Can we keep other statements in between try, catch and finally blocks?
Can we write only try block without catch and finally blocks?
Can we keep the statements after finally block If the control is returning from the finally block itself?
Can we throw an exception manually? If yes, how?
Can we override a super class method which is throwing an unchecked exception with checked exception in the sub class?
Does finally block get executed If either try or catch blocks are returning the control?
Give some examples to checked exceptions?
Give some examples to unchecked exceptions?
What is Exception Handling in Java?
Differentiate between Checked and Unchecked Exceptions.
What are the core components of Java's exception handling mechanism?
Explain the try-catch-finally block in Java.
Can finally block be skipped?
What are the advantages of using finally block?
What is the purpose of the throws keyword?
Can you rethrow an exception in Java?
How do you handle multiple exceptions in Java?
What is the difference between throw and throws in Java?
Explain the concept of Custom Exceptions.
What are the best practices for exception handling in Java?
What design pattern is used to implement exception handling features in most languages?
What is the need for finally block?
What is the difference between error and exception?
What is the difference between checked exceptions and unchecked exceptions?
What happens when you throw a checked exception from a method?
What are the options you have to eliminate compilation errors when handling checked exceptions?
Why is exception handling important?
How do you throw an exception from a method?
How do you create a custom exception?
How do you handle multiple exception types with same exception handling block?
How does try with resources work?
In what scenarios is code in finally not executed?
Will finally be executed in the program below?
  • Exception - Checked Exception, Unchecked Exception, Error
  • try, catch, finally
  • throw, throws
  • final, finally, and finalize()
  • Optional Class
  • Custom Exceptions
  • Exception Propagation
  • Re-throwing Exceptions
  • Try-with-Resources
  • Hierarchy of Exceptions
  • getCause() and initCause()
  • Thread.setDefaultUncaughtExceptionHandler()
  • ExceptionInInitializerError vs NoClassDefFoundError
  • RuntimeException Subclasses
  • Suppressed Exceptions
  • Chained Exceptions
  • Exception Wrapping
  • Multi-level Exception Handling
  • Built-in Exceptions
  • DataAccessException
  • IllegalArgumentException and IllegalStateException
  • @ExceptionHandler & @ExceptionMapper
  • @ControllerAdvice
  • @ResponseStatus
  • @RestControllerAdvice & @RestClientExceptionMapper
  • @SneakyThrows
  • @Throws
  • @ApplicationException
  • @Retryable and @Recover
  • @Valid and @Validated
  • @Transactional
  • @Test(expected = ...)
  • @Rule and ExpectedException
   Built-in_Exceptions   

No comments:

Post a Comment

Most views on this month

Popular Posts