我的秋招面试问题集

第一家

  1. 说说你怎么理解threadlocal的?
  2. ReentrantLock原理?
  3. [1,2,3,4,4,5] 数组找出4所在的所有下标?

Synchronized

偏向锁 01

轻量级锁 00

重量级锁 10

对象在内存中的布局分为三块区域:对象头,实例数据,填充数据

SpringBoot中如何发送邮件

邮件发送

引入maven dependency

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<!-- https://mvnrepository.com/artifact/javax.mail/mail -->
<dependency>
	<groupId>javax.mail</groupId>
	<artifactId>mail</artifactId>
	<version>1.4.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
	<artifactId>freemarker</artifactId>
	<version>2.3.28</version>
</dependency>

SpringBean生命周期方法

对Spring Bean 生命周期方法的总结

1
2
3
4
@Bean(initMethod = "initMethod", destroyMethod = "destroyMethod")
public BeanTest beanTest() {
	return new BeanTest();
}