面试N3:掌握好主流框架,掌握好基础知识

今天下午面试

面试是在陆家嘴软件园,环境真是优美,真是大气。

面试我的是个小哥,估计也就二十七八,可能是被我的笑容感染了,一直冲我笑,我回敬他一个美丽的笑容,他笑得更欢了,难道是我长得很有喜感?

因为小哥的笑容,让我也放松起来,回答的不是很专业到位。

没有纠结我的学历和经验,也没有笔试题,随口问的java基础

我感觉答得不是很好的题目:

1.你怎么理解spring?

Spring 主要说来是一个容器`~一个管理java bean的轻量级容器.它的IOC(依赖注入)主要用于解决不断实例化java bean带来的内存消耗,们更能专心的处理业务逻辑问题,它的事务管理将事务脱离于程序之外,而它的宗旨也是非侵入式的~~并且它对java的其它技术支持也非常好,所以深受业界的欢迎!

2.你怎么理解面向对象?

面向的一切都是对象。

3.说一说封装。

封装,通俗点说,就是把对象的属性和方法放到一起。封装对象的属性和方法,通过访问修饰权限来控制对对象属性和方法的访问。封装对象的方法,可以达到屏蔽实现操作细节的目的。

4.说一说你平时遇到的runtime exception

import java.nio.*; import java.util.*; class TestException { public static void main(String[] args) { TestException t = new TestException(); t.testIndexOutOfBoundsException(); } // 1。ArithmeticException异常。 被除数为0时触发 public void testArithmeticException() { int a = 10; int b = 0; int c = a/b; } // 2。ArrayStoreException异常。 数组类型不正确时触发 public void testArrayStoreException() { Object x[] = new String[3]; x[0] = new Integer(0); } // 3。BufferOverflowException异常。 public void testBufferOverflowException() { int cap = 10; ByteBuffer bf = ByteBuffer.allocate(cap); System.out.println(bf); for(int i = 0;i <cap;i++) { bf.put((byte)i); } System.out.println(bf); // cause exception bf.put((byte)10); } // 4。BufferUnderflowException异常。 public void testBufferUnderflowException() { int cap = 10; ByteBuffer bf = ByteBuffer.allocate(cap); System.out.println(bf); for(int i = 0;i <cap;i++) { bf.put((byte)i); } System.out.println(bf); // cause exception bf.get(); } // 5。ClassCastException异常。 类的类型不正确的Cast的时候触发。 public void testClassCastException() { Object x = new Integer(0); System.out.println((String)x); } // 6。EmptyStackException异常。 堆栈为空的时候触发 public void testEmptyStackException() { Stack t = new Stack(); t.push (new Object()); t.pop(); // cause exception t.pop(); } // 7。IllegalArgumentException异常。 调用方法时传入不合法的参数的时候触发。 public void testIllegalArgumentException() { Thread.currentThread().setPriority(Thread.MIN_PRIORITY); // caush exception Thread.currentThread().setPriority(99); } // 8。IndexOutOfBoundsException异常。 索引超出边界时触发。 public void testIndexOutOfBoundsException() { List l = new ArrayList(); l.add("t"); l.add("a"); l.add("n"); l.add("k"); l.add("s"); Collections.swap(l,0,9); } // 9。ArrayIndexOutOfBoundsException异常。 索引超出数组边界时触发。 public void testArrayIndexOutOfBoundsException() { List v = new ArrayList(); v.add(new Object()); v.get(0); // cause exception v.get(-1); } // 10。StringIndexOutOfBoundsException异常。 索引超出字符串边界时触发。 public void testStringIndexOutOfBoundsException() { String s = "hello"; s.charAt(-1); } }5.你对数据库使用到的关键字。

?url=y_J_O56DspFmgUaxHNHnWohMR08XgUY7eAyg9xhIdY-gnOxl0Ufae4Mr-VyDsTn_GzTdX__0ZHH9LJUnSdZ6q_

6.说说链表(在我说道hashmap是双向链表存储时,他问的)

简单点就是在内存中一个不规则的存储数据的链子 您可以自己画出来 一个节点随机分出另一个节点 节点中存储着数据的引用,,也就是内存地址。这样访问速度相当快

哎哟 每台了 嘻嘻睡吧 明天再来看节目 哈哈

就看你能不能战胜它。战胜了,你就是英雄,就是生活的强者。

面试N3:掌握好主流框架,掌握好基础知识

相关文章:

你感兴趣的文章:

标签云: