Compiler Error J0023

Expected 'catch' or 'finally'

The compiler expected to find a catch or finally block immediately following a corresponding try block.

The following example illustrates this error:

public class Simple {
   public void method1(){
      try {
         // do something meaningful
      }
   } // error: 'catch' or 'finally' not found
}

The following example illustrates the correct syntax for using a try/catch block:

public clas Simple{
   public void method1(){
      try{
        //Do something here. Possibly throw an exception type
      }
      catch(Exception e){
         /*Handle any errors here and use the 'Exception' object to
         determine the type of error that occurred */
      }
   }
}