There was error occurred in Line 14.
Exception in thread \"main\" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type:
>
The code you provided runs fine on my computer.
I'm guessing you are using Netbeans and may be affected by a bug. Try this:
Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application. This will make sure all your source code becomes recompiled before running it.
Link: https://forums.netbeans.org/topic43241.html