Java: startingPath as “public static final” exception

后端 未结 5 1051
天涯浪人
天涯浪人 2021-01-26 13:00

[Updated, sorry about the change but now to the real problem] I cannot include try-catch-loop there for the exception from the method getCanonicalPath(). I trie

5条回答
  •  -上瘾入骨i
    2021-01-26 13:27

     public static final String startingPath = (new File(".")).getCanonicalPath();
    

    You are missing the type of variable startingPath

提交回复
热议问题