Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
579 views
in Technique[技术] by (71.8m points)

java - Uncompilable source code - Erroneous sym type:

There was error occurred in Line 14.

Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type:

Hard to find solution.

package example;

public class Num
{
    public static void main(String [] args) 
    {
    String s = "42";
        try 
        {
            s = s.concat(".5"); 
            double d = Double.parseDouble(s);
            s = Double.toString(d);
            int x = (int) Math.ceil(Double.valueOf(s).doubleValue()); //Line 14
            System.out.println(x);
        }
        catch (NumberFormatException e) 
        {
            System.out.println("Wrong Number");
        }
    }
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...