Is it possible to write a method that is available at package-level? Assume foo
is a package:
long version = foo.getPackageVersion();
No, it is not. Methods can only be defined on classes. Nowhere else.
A package is not physical, it can't serve as a container for byte code. Packages are nothing but namespaces for classes, enums and interfaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With