Category: Java
-
JavaJava Multi-catch block
One or more catch blocks may come after a try block. A distinct exception handler must be present in each…
June 23, 2022
-
JavaNested try block & try with Resource Statement
Nested try block in Java: Java allows the use of try blocks inside of other try blocks. The term “nested…
June 23, 2022
-
Javathrow, throws & finally
The Java keywords for managing exceptions include throw, throws, and finally. throw keyword: To throw an exception explicitly in Java,…
June 23, 2022
-
JavaJava custom( user-defined) exception
Because our own exceptions are derived classes of Exception, Java allows us to create them. A custom exception or user-defined…
June 24, 2022
-
JavaException Handling with Method Overriding in Java
Exception Handling with Method Overriding: Ambiguity arises when method overriding and exception handling are combined. Which definition should be followed…
June 25, 2022
-
JavaChained Exceptions
What are Chained Exceptions? One exception can be related to another using chained exceptions. We can use the chained exception…
June 27, 2022
-
JavaMultithreading in Java
Java’s multithreading feature enables the concurrent execution of two or more program components for maximum CPU efficiency. A thread refers…
June 28, 2022
-
JavaThe life cycle of a Thread
In Java, a thread can be in any of the following states at any given time. A thread is only…
June 29, 2022
-
JavaJava Thread Class
The java.lang.Thread class is a thread of execution in a program. The Java Virtual Machine enables an application to run…
June 30, 2022
-
JavaCreating a Thread in Java
A thread can be created in one of two ways: By extending the Thread class By implementing Runnable interface. Implementing…
July 1, 2022
-
JavaJava join() method
join() method: The join() method of the Java.lang.Thread class enables one thread to wait until another thread has finished running….
July 2, 2022
-
JavaThread.sleep() method in Java
Thread.sleep() method in Java: The two variations of the sleep() method are available from the Java Thread class. The first…
July 5, 2022