Java equivalent of Perl's hash

前端 未结 8 1228
粉色の甜心
粉色の甜心 2021-01-18 02:05

I\'ve been using a lot Perl hashes due to super flexibility and convenient. for instance, in Perl I can do the following:

$hash{AREA_CODE}->{PHONE}->{S         


        
8条回答
  •  醉梦人生
    2021-01-18 02:09

    If the hash keys are constant, why won't hash.getAreaCode().getPhone().getStreetAddr() do? Keep in mind that either your getters or your constructors will need to handle default value generation.

提交回复
热议问题