Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
102 views

Java Exception - Handle Exceptions in Java

The document discusses various types of exceptions in Java including NumberFormatException, NullPointerException, IndexOutOfBoundsException, and other runtime exceptions. It provides examples of when these exceptions may occur, such as when converting a string to a number, accessing a null object, or passing an invalid parameter to a method. The document also covers how to handle exceptions in Java using try/catch blocks and describes finally blocks and user-defined exceptions.

Uploaded by

Rashu Surana
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Java Exception - Handle Exceptions in Java

The document discusses various types of exceptions in Java including NumberFormatException, NullPointerException, IndexOutOfBoundsException, and other runtime exceptions. It provides examples of when these exceptions may occur, such as when converting a string to a number, accessing a null object, or passing an invalid parameter to a method. The document also covers how to handle exceptions in Java using try/catch blocks and describes finally blocks and user-defined exceptions.

Uploaded by

Rashu Surana
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Java Exception - Handle Exceptions in Java

1. Exceptions in Java Exception is a run-time error which arises during the execution of java program. The term exception in java stands for an exceptional event. It can be defined as abnormal event that arises during the execution and normal flow of program.

2. Exceptional Example in Java When an error occurs in a method, Java creates an object of the Exception method. On making an object of exception method, java send it to the program by throwing the object of exception method.

3. Number Format Exception NumberFormatException is a subclass of the Runtime Exception class. A Number Format Exception occurs in the java code when a programmer tries to convert a String into a number.

4. Null Pointer Exception Null pointer exceptions are the most common run time exception error arises during execution of java program. All values in Java programs are references to objects, and all the value in variable are default one.

5. Index Out of Bound Exception Index Out of Bound Exception are the Unchecked Exception that occurs at run-time errors. This arises because of invalid parameter passed to a method in a code.

6. Exception in Java Learn about the Java Exceptions and how to catch the exception.

7. Exception handling in Java What is exception and exception handling in Java. This tutorial is going to show you how to handle different types of exception in Java with the example codes. 8. Class exception Java Here we are describing the example to show the use of Java class exception. Go through the

given example to find about such exceptions and the cause of occurring it.

9. Argument exception java Here we are describing the use of using Argument exception in java .Exceptions are the way in Java to indicate to a calling method that an abnormal condition has occurred.

10. Compiling Java files Here we are describing the way to compile the java file with the help of the java program.

11. Constructor Exception in java In this java program we are writing code for handling Constructor exception. By Handling exception we generally mean handling errors.

12. Array list exception This tutorial describes how to handle Array list exceptions appropriately in your programs and designs.

13. Java cast exception The example is talking about the exception that occurs during the type casting in Java program. Here you will be able to see and handle the java cast exception.

14. Java clone exception Clone means true copy of any thing whether it is a human being or application program. In this tutorial we will show you how to create a clone and handling the exception that occurs due to it in Java.

15. Collection exception in java The tutorial is about the use of collection in Java and the exception that occurs when some unexpected situation occurs in program like deletion of files etc.. here you will learn to handle such type of collection error in Java.

16. List of Java Exception Exception in Java are classified on the basis of the exception handled by the java compiler.

17. User Defined Exception As we come across Built -in-exception, you create own customized exception as per

requirements of the application. On each application there is a specific constraints.

18. Java Interface As you know, Interface is just a reference type that do not contain method and body in Java. It is just like any other class. In this tutorial we are going to discuss about the Java Interface error and will show you how to handle it.

19. Java double exception In this section, you are learning about handling double exceptions in Java. In Java double is used to store the decimal value, here we will learn why the double exception occurs.

20. Java enumeration exception The tutorial is going to describe Java Enumeration and the type of exception occurs while using it in your program.

21. Finally exception java Finally block is optional, if you want you can use it with try and catch block. But if you want to do more then exception handling, use finally. In this example we are going to show you finally exception in java.

22. Integer exception If you are developing the application, you can face any type of exceptions. Integer exception could be one of them. This type of exception occurs when user enters the wrong value. This tutorial describes how to handle integer exceptions appropriately in your programs and designs.

23. Exception object in java In this Java Exception tutorial, you have learned about various types of exception in Java. But the given example is going to show you how to create an object of an exception in Java. Creating objects in Java is very simple and easy to learn an use.

24. Java array exception Introduction to Java Array Exception and solutions to handle it. This tutorial illustrate array exception in Java, it's cause of occurring and steps to handle it.

25. Array out of bounds exception In the given example, you will be introduced with array out of bound exception in Java, and the

way to handle such kind of exception.

26. Hashmap Exceptions Hash Map is used to provide key Value access to data. In this example we are describing the way to handle HashMap exception appropriately in your programs and designs.

27. Hash table in java In this section, we are describing, what is the hash table and and when a hash-table exception occurs in Java.

28. Iterator exception in java This Example will show you, how and when Iterator exception occurs in Java and what are the possible ways of handling these types of exception. Go through the given Java Iterator example to see how to use an Iterator in separate parts of your program.

29. User Defined Exception As we come across Built -in-exception, you create own customized exception as per requirements of the application. On each application there is a specific constraints.

30. Java Illegal State Exception The java. lang package include several classes and exceptional classes. This exceptional classes are the subclasses of run-time exception, that is used further in exception handling.

31. Unhandled Exception Unhandled Exception are the exception that are thrown during the execution of program. These exception are never caught during the execution of program.

32. Java Assertion Assertion are simple check assumption made at the beginning of the program to ensure the program is true throughout provided by the Java language.

33. Serializable Exception Serialization is the process of writing an class object that is transmitted through the network in the encoded stream of byte form. This Encoded form can be reconstructed from the network by reading from byte of stream.

34. Java Parse int Exception Static method in parseInt is derived from package java.lang.integer.public static method int parseInt(String s) gives you NumberFormatException.

35. List of Java Exception Exception in Java are classified on the basis of the exception handled by the java compiler.

36. Java Exception Thread Thread is the independent path of execution run inside the program. Many Thread run concurrently in the program. Multithread are those group of more than one thread that runs concurrently in a program.

37. Simple Date Format Exception Simple Date Format Exception inherits from a package name java.text.SimpleDateFormat and implements interfaceCloneable,Serializable.SimpleDateFormat is a concrete class.

You might also like