Can final keyword be used for a method?
相关问题
- 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
Yes, it is possible to declare a method as
final
. That will mean that a method cannot be overridden by its subclasses.From The Java Language Specifications, Third Edition, Section 8.4.3.3:
For more information, the Writing Final Classes and Methods page from The Java Tutorials has more information.
Sure can. Making it impossible to override.