如何在地图中存储多个字符串? [英] How to store more than one string in a Map?

查看:86
本文介绍了如何在地图中存储多个字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以设置两个以上的值吗?

Is it possible to set more than two pair value?

例如:

Map<String,String,String,String>

号码,姓名,地址,电话 - 全部汇集在一起​​显示值。每个与他人相关的值。

number,name,address,phone - All come together for display the values. Each value associated with others.

推荐答案

你的对象被拒绝。您应该使用一个持有数字,名称,地址,电话的对象(也许您可以将其称为 ContactInformation )并将其放入地图。

You're in object denial. You should use an object that holds the number, name, address, phone (maybe you could call it ContactInformation) and put that into the map.

这篇关于如何在地图中存储多个字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆