搜课云网 > 上海内威培训 > 资讯总汇 > JAVA面试题

JAVA面试题

机构:上海内威培训 时间:2016-01-25 08:50:41 点击:613

  一、基础题

  1、写出输出结果:

  public class TryCatch {

  public static void main (String args[]){

  TryCatch tc=new TryCatch ();

  tc.method();

  }

  public void method() {

  try{

  System.out.println("A");

  int i=10/0;

  System.out.println("B");

  }

  catch (Exception e){

  System.out.println("C");

  }

  finally{

  System.out.println("D");

  }

  }

  }

  2、写出三个以上你用过 JAVA Exception.

  3.如何获得数组的长度、List的长度、String的长度。

  4、定义Spring的属性的时候,含有一常用的属性,例如:

  Scope 有什么作用,列出常用的scope.

  5、什么叫Hibernate的延时加载,有什么优点和缺点?

  二、编程题

  1、长度为n的数组,需要在数组第m位插入一个数value,插入后数组的长度为m+1位,

  例如:数组为{2,30,3,6,11},在第二位插入值56,结果是:{2,30,56,3,6,11}

  完成函数insertAt:

  public int[] insertAt(int[] array,int pos,int value){

  }

  2、请用递归算法写出整数n的阶乘。

  3、已知 表user: 字段 id ,name ,age。要求查出age>所有人的name;

  public List query(java.sql.connection con,int age){

  };

  了解更多关于软件方面的知识,请访问上海软件培训学校

 

师资介绍