4 ms·
Why not? Java support reflection, so you can - at runtime - enumerate all the properties of an object. From there, you would assign each property from a to b. T
by syrrim 9y ago
Why not? Java support reflection, so you can - at runtime - enumerate all the properties of an object. From there, you would assign each property from a to b. The only thing stopping this is that not all properties will be public, but this seems like a pedantic hangup to me. They are functionally equivalent.
- adrianmonk 9y agoSubclasses and final fields make this impossible in the general case.