Why do some folks use Class#method instead of Class.method in correspondence?

It’s the notation used in javadoc comments when linking to another class’ method.

EDIT

To gather the additional information provided in comments:

  • @Hugo notes that the # notation in turn comes from HTML anchors
  • @maksimov points out that Object.method is the Java syntax to call static methods, which could be misleading

UPDATE

Java 8 brings a new syntax for method references, which now seems to become more popular – so Object#toString tends to now be written Object::toString.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)