2017秋招艺龙旅行网研发工程师一面面经
1.数据库索引的B Tree和Hash实现的区别
2.b 和b-的区别
3.数据库left join和right join
4.Redis相关
5.List中为什么不能装入int
6.多态和重写
7.创建线程的方法
8.run()和start()的区别
9.输出什么?i的数值变化过程?
public static void testException(){
List<String> testList=null;
int i=0;
try{
for(String str:testList){
System.out.println(str);
}
}catch (Exception e){
i=1;
e.printStackTrace();
}finally {
i=2;
}
System.out.println(i);
List<String> testList=null;
int i=0;
try{
for(String str:testList){
System.out.println(str);
}
}catch (Exception e){
i=1;
e.printStackTrace();
}finally {
i=2;
}
System.out.println(i);
}
10.
public class ParentVo {
private Integer t1=1;
private Integer t2=2;
public Integer getT1() {
return t1;
}
public void setT1(Integer t1) {
this.t1 = t1;
}
public Integer getT2() {
return t2;
}
public void setT2(Integer t2) {
this.t2 = t2;
}
private Integer t1=1;
private Integer t2=2;
public Integer getT1() {
return t1;
}
public void setT1(Integer t1) {
this.t1 = t1;
}
public Integer getT2() {
return t2;
}
public void setT2(Integer t2) {
this.t2 = t2;
}
}
public class Model1 extends ParentVo{
private Integer t1=3;
@Override
public Integer getT1() {
return t1;
}
@Override
public void setT1(Integer t1) {
this.t1 = t1;
}
}
public class Model2 extends ParentVo{
private Integer t2=4;
@Override
public Integer getT2() {
return t2;
}
@Override
public void setT2(Integer t2) {
this.t2 = t2;
}
}
public static void model(){
ParentVo p1=new Model1();
ParentVo p2=new Model2();
System.out.println(p1.getT1());
System.out.println(p2.getT2());
}
private Integer t1=3;
@Override
public Integer getT1() {
return t1;
}
@Override
public void setT1(Integer t1) {
this.t1 = t1;
}
}
public class Model2 extends ParentVo{
private Integer t2=4;
@Override
public Integer getT2() {
return t2;
}
@Override
public void setT2(Integer t2) {
this.t2 = t2;
}
}
public static void model(){
ParentVo p1=new Model1();
ParentVo p2=new Model2();
System.out.println(p1.getT1());
System.out.println(p2.getT2());
}
11.
public static void stringsplit(){
String t1="1;2;;;";
String t1Array1[]=t1.split(";");
String t1Array2[]=t1.split(";",t1.length());
System.out.println(t1Array1.length);
System.out.println(t1Array2.length);
}
String t1="1;2;;;";
String t1Array1[]=t1.split(";");
String t1Array2[]=t1.split(";",t1.length());
System.out.println(t1Array1.length);
System.out.println(t1Array2.length);
}
12.
public static void calculateData(){
List<Integer> dataList=new ArrayList<>();
dataList.add(2);
dataList.add(4);
dataList.add(3);
dataList.add(6);
dataList.add(3);
dataList.add(6);
dataList.add(8);
dataList.add(7);
dataList.add(1);
//用最简单快捷的方式去取两个数相加等于10的任意一对
#Java工程师#List<Integer> dataList=new ArrayList<>();
dataList.add(2);
dataList.add(4);
dataList.add(3);
dataList.add(6);
dataList.add(3);
dataList.add(6);
dataList.add(8);
dataList.add(7);
dataList.add(1);
//用最简单快捷的方式去取两个数相加等于10的任意一对
}
补充:
1.图的深度优先遍历和广度优先遍历
2.如何解决hash冲突