When writing about methods in Java (i.e. in forums, mailing lists, issue trackers, etc.) many people separate the method name from the class name using the '#' symbol instead of Java's native .
operator; for example, folks refer to Object#toString
instead of Object.toString
. Where does this syntax come from?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
It's the notation used in javadoc comments when linking to another class' method.
EDIT
To gather the additional information provided in comments:
#
notation in turn comes from HTML anchorsObject.method
is the Java syntax to call static methods, which could be misleadingUPDATE
Java 8 brings a new syntax for method references, which now seems to become more popular - so
Object#toString
tends to now be writtenObject::toString
.