java读取txt文件内容并且转换成java代码输出在新的txt中 10
txt内容是1.您的年龄,即您的周岁:(java定义类型为type1)A.22~30岁B.31~40岁C.41~50岁D.50岁以上java代码为:Map<String,...
txt内容是
1.您的年龄,即您的周岁:(java定义类型为type1)
A.22~30岁
B.31~40岁
C.41~50岁
D.50岁以上
java代码为:
Map<String, Object> map1 = new HashMap<String, Object>();
map1.put(OnlineInquiryAdapter.KEY_NAMES[0], "");
map1.put(OnlineInquiryAdapter.KEY_NAMES[1], OnlineInquiryAdapter.type1);
map1.put(OnlineInquiryAdapter.KEY_NAMES[2], "1. 您的年龄,即您的周岁:");
List<Map<String, String>> options1 = new ArrayList<Map<String, String>>();
Map<String, String> option_item1 = new HashMap<String, String>();
option_item1.put(OnlineInquiryAdapter.KEY_OPTIONS[0], "");
option_item1.put(OnlineInquiryAdapter.KEY_OPTIONS[1], "A. 22~30岁");
options1.add(option_item1);
Map<String, String> option_item2 = new HashMap<String, String>();
option_item2.put(OnlineInquiryAdapter.KEY_OPTIONS[0], "");
option_item2.put(OnlineInquiryAdapter.KEY_OPTIONS[1], "B. 31~40岁");
options1.add(option_item2);
Map<String, String> option_item3 = new HashMap<String, String>();
option_item3.put(OnlineInquiryAdapter.KEY_OPTIONS[0], "");
option_item3.put(OnlineInquiryAdapter.KEY_OPTIONS[1], "C. 41~50岁");
options1.add(option_item3);
Map<String, String> option_item4 = new HashMap<String, String>();
option_item4.put(OnlineInquiryAdapter.KEY_OPTIONS[0], "");
option_item4.put(OnlineInquiryAdapter.KEY_OPTIONS[1], "D. 50岁以上");
options1.add(option_item4);
map1.put(OnlineInquiryAdapter.KEY_NAMES[3], options1);
data.add(map1);
还有一个
options1.add(option_item4);
中的options1这个编号就是题号,第一题是1,第二题是2
item后面的编号可以是选项号ABCD也可以是1234 展开
1.您的年龄,即您的周岁:(java定义类型为type1)
A.22~30岁
B.31~40岁
C.41~50岁
D.50岁以上
java代码为:
Map<String, Object> map1 = new HashMap<String, Object>();
map1.put(OnlineInquiryAdapter.KEY_NAMES[0], "");
map1.put(OnlineInquiryAdapter.KEY_NAMES[1], OnlineInquiryAdapter.type1);
map1.put(OnlineInquiryAdapter.KEY_NAMES[2], "1. 您的年龄,即您的周岁:");
List<Map<String, String>> options1 = new ArrayList<Map<String, String>>();
Map<String, String> option_item1 = new HashMap<String, String>();
option_item1.put(OnlineInquiryAdapter.KEY_OPTIONS[0], "");
option_item1.put(OnlineInquiryAdapter.KEY_OPTIONS[1], "A. 22~30岁");
options1.add(option_item1);
Map<String, String> option_item2 = new HashMap<String, String>();
option_item2.put(OnlineInquiryAdapter.KEY_OPTIONS[0], "");
option_item2.put(OnlineInquiryAdapter.KEY_OPTIONS[1], "B. 31~40岁");
options1.add(option_item2);
Map<String, String> option_item3 = new HashMap<String, String>();
option_item3.put(OnlineInquiryAdapter.KEY_OPTIONS[0], "");
option_item3.put(OnlineInquiryAdapter.KEY_OPTIONS[1], "C. 41~50岁");
options1.add(option_item3);
Map<String, String> option_item4 = new HashMap<String, String>();
option_item4.put(OnlineInquiryAdapter.KEY_OPTIONS[0], "");
option_item4.put(OnlineInquiryAdapter.KEY_OPTIONS[1], "D. 50岁以上");
options1.add(option_item4);
map1.put(OnlineInquiryAdapter.KEY_NAMES[3], options1);
data.add(map1);
还有一个
options1.add(option_item4);
中的options1这个编号就是题号,第一题是1,第二题是2
item后面的编号可以是选项号ABCD也可以是1234 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询