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

前端 未结 5 1075
渐次进展
渐次进展 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 21:01

    I think you're trying to avoid ugly names like Util.andThen. Consider using static imports. That lets you import all the methods in the header import static org.ogsl.Util.*, so then you can simply use you andThen without any prefix at all.

提交回复
热议问题