Should I implement named parameters in Java using Hash tables?
I saw this entry:
: but I did not want to use the builder method which seemed overly verbose
Should I implement named parameters in Java using Hash tables?
I saw this entry:
: but I did not want to use the builder method which seemed overly verbose
There is no such thing as named parameters in Java.
There are workarounds and there have been submissions in Project Coin but they were rejected. Sun is well aware that there is a demand but, so far, they have rejected any such language change.
Using Maps as suggested above is a possibility but unless all your arguments have the same type, it is cumbersome. And it's not really efficient either.