Tag Archives: Exception Handling

In this article, the enhancements made by Oracle in version 1.7, along with its implementation, has been discussed. As a part of 1.7 version enhancement,… Read More
In Ruby, exception handling is a process which describes a way to handle the error raised in a program. Here, error means an unwanted or… Read More
Prerequisite: Throw and Throws in Java The differences between throw and throws are: Point of usage throw keyword is used inside a function. It is… Read More
In Java, there are three methods to print an exception information. All of them are present in Throwable class. Since Throwable is the base class… 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 either… Read More
NullPointerException is a RuntimeException. In Java, a special null value can be assigned to an object reference. NullPointerException is thrown when program attempts to use… Read More
Consider the following code snippets: filter_none edit close play_arrow link brightness_4 code public class Geeksforgeeks {     public static void main(String[] args)     {         double p =… Read More
Predict the output of the following program. filter_none edit close play_arrow link brightness_4 code class Test {   int count = 0;        void A() throws… Read More
Predict the output of the following program. filter_none edit close play_arrow link brightness_4 code class Test {     String str = "a";        void A()     {… Read More
filter_none edit close play_arrow link brightness_4 code class Test {     public static void main(String[] args)     {         try         {             int a[]= {1, 2, 3, 4};             for… Read More
filter_none edit close play_arrow link brightness_4 code class Test {     public static void main (String[] args)     {         try         {             int a = 0;             System.out.println ("a… Read More
filter_none edit close play_arrow link brightness_4 code class Base extends Exception {} class Derived extends Base  {}    public class Main {   public static void… Read More
Output of following Java program? filter_none edit close play_arrow link brightness_4 code class Main {    public static void main(String args[]) {       int x = 0;… Read More
filter_none edit close play_arrow link brightness_4 code class Test extends Exception { }     class Main {    public static void main(String args[]) {        try {… Read More
Predict the output of following Java program filter_none edit close play_arrow link brightness_4 code class Main {    public static void main(String args[]) {       try {… Read More