Java里面怎么将1,2,3,4,5赋值为壹,"贰","叁","肆","伍".. (新手不懂赋值语句)
2个回答
展开全部
你可以使用map
拿"1"
“2”
“3”
“4”
“5”
.....当键
key
壹,"贰","叁","肆","伍"..
当值
value
如:
Map
hanzi
=
new
HashMap();
hanzi.put("1","壹");
hanzi.put("2","贰");
hanzi.put("3","叁");
hanzi.put("4","肆");
hanzi.put("5","伍");
然后你就可以按照你输入的
"1“
”2"
"
3“
”4“
”5”
(注意啊这写12345
也都是字符串啊)来获取
壹,"贰","叁","肆","伍
了
拿"1"
“2”
“3”
“4”
“5”
.....当键
key
壹,"贰","叁","肆","伍"..
当值
value
如:
Map
hanzi
=
new
HashMap();
hanzi.put("1","壹");
hanzi.put("2","贰");
hanzi.put("3","叁");
hanzi.put("4","肆");
hanzi.put("5","伍");
然后你就可以按照你输入的
"1“
”2"
"
3“
”4“
”5”
(注意啊这写12345
也都是字符串啊)来获取
壹,"贰","叁","肆","伍
了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询