求助一些题目,都是笔试遇到的
1.现有一个类A。能不能注入两个bean,bean名分别为nameA,nameB。 使用时该如何使用
2.Class A {
private Integer id;
private String name;
}
List<A> aList = new ArrayList();
1)将 aList 转换成 Map<Integer, A>, key 为 id, value为A。
2)
相同id存在多条记录,将aList 转换成 Map<Integer, List<A>>
3) 将 1), 2) 用 java8 的 stream 方式实现
3.@Deprecated, @ConfigurationProperties, @Value 注解分别是什么意思,适用在什么场景
4.linux a.txt 内容如下:
2019-07-19 3 a
2019-07-18 10 b
2019-07-17 2 a
2019-07-16 1 a
如何使用linux命令,达到如下输出效果(即只输出第二列)
3
10
2
1
5.活动表
CREATE TABLE `activity_info` (
`act_id` bigint(20) NOT NULL AUTO_INCREMENT,
`act_title` varchar(64) NOT NULL DEFAULT '' COMMENT '活动标题',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '活动描述',
`start_time` int(11) NOT NULL DEFAULT '0',
`end_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
`update_by` varchar(32) NOT NULL DEFAULT '',
`create_time` int(11) NOT NULL DEFAULT '0',
`create_by` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`act_id`)
) ENGINE=InnoDB AUTO_INCREMENT=440 DEFAULT CHARSET=utf8mb4
需求 不能同时存在两个活动,该如何实习。(思路和sql)
#笔试题目##Linux##Java##MySQL#
2.Class A {
private Integer id;
private String name;
}
List<A> aList = new ArrayList();
1)将 aList 转换成 Map<Integer, A>, key 为 id, value为A。
2)
相同id存在多条记录,将aList 转换成 Map<Integer, List<A>>
3) 将 1), 2) 用 java8 的 stream 方式实现
3.@Deprecated, @ConfigurationProperties, @Value 注解分别是什么意思,适用在什么场景
4.linux a.txt 内容如下:
2019-07-19 3 a
2019-07-18 10 b
2019-07-17 2 a
2019-07-16 1 a
如何使用linux命令,达到如下输出效果(即只输出第二列)
3
10
2
1
5.活动表
CREATE TABLE `activity_info` (
`act_id` bigint(20) NOT NULL AUTO_INCREMENT,
`act_title` varchar(64) NOT NULL DEFAULT '' COMMENT '活动标题',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '活动描述',
`start_time` int(11) NOT NULL DEFAULT '0',
`end_time` int(11) NOT NULL DEFAULT '0',
`update_time` int(11) NOT NULL DEFAULT '0',
`update_by` varchar(32) NOT NULL DEFAULT '',
`create_time` int(11) NOT NULL DEFAULT '0',
`create_by` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`act_id`)
) ENGINE=InnoDB AUTO_INCREMENT=440 DEFAULT CHARSET=utf8mb4
需求 不能同时存在两个活动,该如何实习。(思路和sql)
#笔试题目##Linux##Java##MySQL#