Skip to content

Tag Archives: Java-Exception Handling

ArrayStoreException in Java occurs whenever an attempt is made to store the wrong type of object into an array of objects. The ArrayStoreException is a… Read More
In java, both Errors and Exceptions are the subclasses of java.lang.Throwable class. Error refers to an illegal operation performed by the user which results in… Read More
Prerequisite : Try-Catch Block in Java In Java, it is possible that your program may encounter exceptions, for which the language provides try-catch statements to… Read More
Prerequisite : Exceptions in Java, Checked vs Unchecked Exceptions Exception propagation : An exception is first thrown from the top of the stack and if… Read More
Prerequisite: Exceptions in Java For every thread, JVM (Java virtual machine) creates a run-time stack.  Each and every call performed in a thread is stored… Read More
Prerequisite : try-catch, Exception Handling1. What will be the output of the following program?  Java class Geeks {     public static void main(String[] args)     {         try… Read More
Prerequisite : Exception Handling, Throws 1. What will be the output of the following program? class Geeks { public     static void main(String[] args)     {         throw… Read More
In java 7 or 8 if a resource is already declared outside the try-with-resources statement, we should re-refer it with local variable. That means we… Read More
Prerequisites : Exception handling , control flow in try-catch-finally 1) What is the output of the following program? public class Test {     public static void… Read More
In this article, we’ll explore all the possible combinations of try-catch-finally which may happen whenever an exception is raised and how the control flow occurs… Read More
  throw The throw keyword in Java is used to explicitly throw an exception from a method or any block of code. We can throw… Read More
Predict the output of the following program. class Test {   int count = 0;        void A() throws Exception     {         try         {             count++;                            try… Read More
Predict the output of the following program. class Test {     String str = "a";        void A()     {         try         {             str +="b";             B();         }         catch… Read More
class Test {     public static void main(String[] args)     {         try         {             int a[]= {1, 2, 3, 4};             for (int i = 1; i <= 4;… Read More
class Test {     public static void main (String[] args)     {         try         {             int a = 0;             System.out.println ("a = " + a);             int b =… Read More

Start Your Coding Journey Now!