记 Java 面试的时候被问的最多的问题

2017-03-02 11:51:44 +08:00
 a1310747
1.jvm,gc 巴拉巴拉
2.spring 巴拉巴拉
3.分布式巴拉巴拉
4.线程巴拉巴拉
5.sql 巴拉巴拉
8722 次点击
所在节点    Java
34 条回复
a1310747
2017-03-02 14:01:06 +08:00
@hand515 对...
a1310747
2017-03-02 14:01:46 +08:00
@shawshi 的确 这个也是问的比较多的
a1310747
2017-03-02 14:05:03 +08:00
@NamekMaster 并不是....分布式我也只用了 zookeeper+dubbo 不过面试官会往深了问 比如: dubbo 的实现原理、内部层次结构等,是否读过 dubbo 源码, zookeeper 的实现原理,如何做到事务的注册和订阅, dubbo 与 zookeeper 如何结合,是否读过 zookeeper 源码等等
a1310747
2017-03-02 14:05:18 +08:00
@henneko 有了
Ouyangan
2017-03-02 16:42:20 +08:00
@Cbdy #19 这个问题最考验功力了, 缺乏工程经验看编程思想导论部分看的会非常难受..
Tneciv
2017-03-02 17:06:14 +08:00
我被问过如何用 3 种方法安装 MySQL
xiaowangge
2017-03-03 00:22:47 +08:00
@wohenyingyu02 核心知识点

1 、== 和 equals 方法的区别

2 、 Java caches Integer objects instances from the range -128 to 127. The reasoning is explained here: https://blogs.oracle.com/darcy/entry/boxing_and_caches_integer_valueof
Lonely
2017-03-03 04:23:28 +08:00
@wohenyingyu02 你问得模糊还说没人全对
wohenyingyu02
2017-03-03 10:27:10 +08:00
@Lonely 一共 6 道判断题,你连题都没看就说模糊?
public class test {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Integer a=2;
Integer b=2;
System.out.println("1. " + (a==b));

Integer c=1000;
Integer d=1000;
System.out.println("2. " + (c==d));

int e=1000;
int f=1000;
System.out.println("3. " + (e==f));

Integer g = 50;
int h = 50;
System.out.println("4. " + (g==h));

Integer i = 500;
int j = 500;
System.out.println("5. " + (i==j));

Integer k = new Integer(1);
Integer l = new Integer(1);
System.out.println("6. " + (k==l));
}

}


@nec
@xiaowangge

要是来的人都和 V2EX 一样厉害估计我都失业了哈哈
GavinHao
2017-03-03 11:22:43 +08:00
true false true true false false 应该是吧?嘿嘿嘿 我是彩笔
jhdxr
2017-03-03 12:34:45 +08:00
@GavinHao 第五个应该是 true 吧, i 会自动拆包然后再和 j 比较的
thekll
2017-03-03 15:11:04 +08:00
通过反射访问 private 变量从业务或者应用角度来看有什么必要性?毕竟这种方式破坏了 private 的封装性。
a1310747
2017-03-03 16:13:18 +08:00
@wohenyingyu02
我对这块也才了解...刚刚去做了 11 个题目 错了三 - -
Integer a = 1;
Integer b = 1;
Integer c = 2;
Integer d = 3;
Integer e = new Integer(3);
Integer e1 = new Integer(3);
Long f = 3L;
Long f1 = new Long(3);

int a1 = 1;
int c1 = 2;

System.out.println("1== Integer(1) ?: " + (new Integer(1) == 1));
System.out.println("a==a1 ?:" + (a==a1));
System.out.println("a==b ?:" + (a==b));
System.out.println("d==e ?:" + (d==e));
System.out.println("e1==e ?:" + (e1==e));
System.out.println("a + c == d ?:" + (a + c == d));
System.out.println("a + c == e ?:" + (a + c == e));
System.out.println("a + c == f ?:" + (a + c == f));
System.out.println("a1 + c1== f ?:" + (a1 + c1 == f));
System.out.println("a1 + c1== f1 ?:" + (a1 + c1 == f1));
System.out.println("a + c equals f ?:" + f.equals(a+c));
log4geek
2017-03-15 11:23:39 +08:00
我这边也收藏了不少面试题,分享给大伙
http://log4geek.cc/category/程序员求职 /

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/344301

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX