was wondering if it's possible to have similar for fields?
Probably not because that is an entirely different thing from how the compiler works and what is considered public in a class. Method parameters are something a caller needs to know. How fields get initialized is very much an implementation detail since it all really just happens in the constructor (field initializers just get inserted into the construction process)
SlimerDude Sat 6 Feb 2016
When using reflection to inspect method parameters, there's a useful Param.hasDefault() method:
I was wondering if it's possible to have similar for fields?
brian Sat 6 Feb 2016
Probably not because that is an entirely different thing from how the compiler works and what is considered public in a class. Method parameters are something a caller needs to know. How fields get initialized is very much an implementation detail since it all really just happens in the constructor (field initializers just get inserted into the construction process)