Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

unchecked exception in java

/* The only unchecked exception in Java are objects of type RunTimeException
   or any of its descendants. Examples include ArithmeticException, NullPointerException,
   IndexOutOfBoundsException, NumberFormatException, InputMismatchException, etc...
*/

// The method below generates an ArithmeticException, which is an unchecked exception,
// and as such requires no throws clause in its header
public void throwArithmeticException() {
	System.out.println(10/0); // Yields an ArithmeticException
}


 
Comment

PREVIOUS NEXT
Code Example
Java :: write in file java 
Java :: Spigot coding how to send a message to player after commadn 
Java :: what is exception in java 
Java :: how to create object of abstract class in java 
Java :: java hash map 
Java :: get intersection of two lists java 
Java :: java spring username encode and decode 
Java :: java double to float 
Java :: java implement interface 
Java :: queue and stack reader 
Java :: copy linked list 
Java :: Java Thread Example by implementing Runnable interface 
Java :: android foreground services set auto cancel not working 
Java :: java letter to number 
Java :: java fields 
Java :: MyArrayList 
Java :: how to create a java library in intellij 
Java :: how to pass a float between activities in android studio 
Java :: no of words in a string in java 
Java :: java convert double to boolean 
Java :: springbootservletinitializer maven dependency 
Java :: convert jwt claim to string java 
Java :: android check file extension 
Java :: java new string 
Java :: how to get the memory location of an object in java 
Java :: could not load main class java 
Java :: next method jdbc 
Java :: How to efficiently find the diameter of a binary tree, in Java? 
Java :: java create array 
Java :: java take and save screenshot 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =