首页 > 其他分享 >eclipse Syntax error on token "String", strictfp expected

eclipse Syntax error on token "String", strictfp expected

时间:2023-02-14 12:05:37浏览次数:33  
标签:String -- eclipse token Syntax strictfp 枚举

1.情景展示

在eclipse当中,创建枚举类报错信息如下:

Syntax error on token "String", strictfp expected

eclipse Syntax error on token "String", strictfp expected_枚举类

2.具体分析

在枚举类当中,当定义了属性后,必须为该枚举类定义元素,否则会爆出类似:Syntax error on token "String", strictfp expected的错误。

3.解决方案

这个错误,其实不用管,在我们添加枚举类型后就会自动消失。

eclipse Syntax error on token "String", strictfp expected_枚举类_02

4.其它

如何创建枚举类?

在需要添加枚举类的位置,右键--》New--》Other(快捷键:Ctrl+N)

eclipse Syntax error on token "String", strictfp expected_后台开发工具_03

选择Enum-->Next;

eclipse Syntax error on token "String", strictfp expected_后台开发工具_04

为枚举类起个好听的名字;

eclipse Syntax error on token "String", strictfp expected_后台开发工具_05

写在最后

  哪位大佬如若发现文章存在纰漏之处或需要补充更多内容,欢迎留言!!!

 作者:​​Marydon​​

标签:String,--,eclipse,token,Syntax,strictfp,枚举
From: https://blog.51cto.com/u_15964717/6056516

相关文章