银河万佳公司面试题
1.哪些关键字用于构造方法:(a)final,(b) static,(c)synchronised,(d)native,(e),全都不行2. system.out.println(a+' '+b); system.out.println(a+" "+b);会输出
1.哪些关键字用于构造方法:(a)final,(b) static,(c)synchronised,(d)native,(e),全都不行 2. system.out.println(a+' '+b); system.out.println(a+" "+b); 会输出结果还是编译不通过 3.哪个不正确? a).Map中的元素能复用 b).Map一个键可映射多个值。 4. public class static stuff{ static int x=10; static {x+=5;} public static void main(String[] args){ System.out.println("x="+x); } static {x/=5;} } a)x=10, b)x=15, c)x=3,d)编译错。 5.interface myInterface{ int x=0; int Mymethod(int x); } class myImplementation implements myInterface{ public int myMethod(int x){ return super.x; } } public class MyTest{ public static void Main(String[] args){ myInterface mi=new myImplementation(); System.out.println(mi.myMethod(10)); } } a)0, b)10, c)运行错,d)编译错。 6.如何强迫垃圾回收机制去回收一个对象 7.public class threadTest implements Runnable{ private int x; public int getData(){ synchronised(x){ x=123; x=x+12; } return x; } public void run(){ system.out.println(getData()+" "); } public static void main(String[] args){ ThreadTest test=new TheadTest(); Thread th1= new Thread(test); Thread th2= new Thread(test); th1.start(); th2.start(); } } A)输出123 135,B)输出123和135交替出现不知先后,C)输出135 135,D)编译错 8.接口内部声明方法,错误的有 A.boolean set Flag(Boolean[] test) B.public float getVol(float x) C.public void main(String[] args) D.public static void main(String[] args) 9.java中finalize()方法有什么? 10.jsp中有哪些内置对象,分别有什么作用 11.jsp中访问数据库信息,怎样防止SQL注入 12.简述Servlet生命周期 13.什么是MVC设计模式,struts是怎样实现MVC设计模式的? 14.什么是O/R mapping,有什么作用,对持久层的设计有什么意义 15.jsp开发技术/EJB开发技术的不同点 16.用javaScript 写一段代码来验证电子邮件的格式,要求使用正则表达式 17.java中的访问MY SQL/Server 的数据库连接代码 18.统计任一目录下,所以目录和文件总数,(包括子目录和文件),要求用递归并在必要的地方注释
很赞哦! (
)