What are the valid characters for a Java method name?

前端 未结 3 1733
广开言路
广开言路 2021-02-08 15:02

I read about the naming of Java variables. It says that Java variables cannot start with any numbers and special characters except for $ and _.

Some valid examples:

3条回答
  •  不思量自难忘°
    2021-02-08 15:08

    You might be surprised when having unusual characters for method, such as:

    public void mój_brzuch_zacznie_burczeć()
    

    and it works pretty nice. Take a look at this blog to see more fancy examples.

提交回复
热议问题