Any risk using a single dollar sign `$` as a java class name?

前端 未结 5 1072
渐次进展
渐次进展 2020-12-18 20:27

Originally I was using the underscore _ as a class name. The new Java8 compiler complains that it \"might not be supported after Java SE 8\". I changed

5条回答
  •  春和景丽
    2020-12-18 20:48

    Yes, to be pedantic about answering your question there is a risk. As some other folks have mentioned, it violates java naming conventions. So the risk is that with future versions of the JDK this may cause problems. But beyond that, and some issues if you try to use nested classes you should be fine.

提交回复
热议问题