i received this error from my code and can't seem to find a solution. This is my first time handling throw exception in java. Any help is appreciated!
C:\Users\acer\Documents\MyFinal3.java:5: error: ';' expected
static void exceptionFinal() throw RuntimeException();{
1 error
import java.io.*;
import java.util.*;
public class MyFinal3
{
static void exceptionFinal() throw RuntimeException eE{
System.out.println("Inside exceptionFinal");
throw RuntimeException();
}
public static void main(String []args)
{
double myDouble[] = new double[5];
try {
exceptionFinal();
System.out.println("Access element sixth :" +
myDouble[6]);
}
catch (RuntimeException eE) {
System.out.println("Exception thrown: 1");
}
catch (Exception eE) {
System.out.println("Exception thrown: 2");
}
catch (ArrayIndexOutOfBoundsException eE) {
System.out.println("Exception thrown: 3" );
}
finally {
System.out.println("Exception end" );
}
System.out.println("Out of the block");
}
}