c*******d 发帖数: 27 | 1 有一道题是:Abstract class的好处是什么?
我答:Abstract class 的好处是为了OO Design的方便,很多Design Pattern 用到了
Abstract class比如Factory。(看来面试官不满意,我没有回答到点子上)
另一道题:既然Java有垃圾回收器,为什么有的Java程序会有memory leak?
如何回答以上问题。谢谢!! | r****t 发帖数: 10904 | 2 你答得不痛不痒嘛,这种朝大方向问的问题你拿个方便就打发了?从enforce protocol
, 和interface比较方面去答嘛,最终要回到ensure program correctness这个中心上
嘛.这和中学政治课一样,就是一通催阿.
java gc的问题,从circular reference来答阿,喔那是c++, 可能你还要懂点jvm,分两点答比较好.
俺基本不懂java, 还是学生物的,就当我胡说了.... | g*****g 发帖数: 34805 | 3 Abstract class is in between interface and concrete class.
You can have abstract methods and concrete methods at the same time.
So common functions can be implemented in superclass and specific
functions (required to be)
implemented in subclasses. Abstract Factory is just one
exmaple, the factory creation method is shared, and products classes
creation methods are abstract.
Common pitfalls: many external resources like DB connection, LDAP connection
, Stream IO,
Socket connection would need expl
【在 c*******d 的大作中提到】 : 有一道题是:Abstract class的好处是什么? : 我答:Abstract class 的好处是为了OO Design的方便,很多Design Pattern 用到了 : Abstract class比如Factory。(看来面试官不满意,我没有回答到点子上) : 另一道题:既然Java有垃圾回收器,为什么有的Java程序会有memory leak? : 如何回答以上问题。谢谢!!
| c*******d 发帖数: 27 | 4 现在学生物的也如此强,真是让我这cs的汗颜。
protocol
分两点答比较好.
【在 r****t 的大作中提到】 : 你答得不痛不痒嘛,这种朝大方向问的问题你拿个方便就打发了?从enforce protocol : , 和interface比较方面去答嘛,最终要回到ensure program correctness这个中心上 : 嘛.这和中学政治课一样,就是一通催阿. : java gc的问题,从circular reference来答阿,喔那是c++, 可能你还要懂点jvm,分两点答比较好. : 俺基本不懂java, 还是学生物的,就当我胡说了....
| r****t 发帖数: 10904 | 5 只是嘴巴上会说,你还是等等高手的答案..
【在 c*******d 的大作中提到】 : 现在学生物的也如此强,真是让我这cs的汗颜。 : : protocol : 分两点答比较好.
| c*******d 发帖数: 27 | 6 Thanks! Your answer is clear and reasonable.
connection
【在 g*****g 的大作中提到】 : Abstract class is in between interface and concrete class. : You can have abstract methods and concrete methods at the same time. : So common functions can be implemented in superclass and specific : functions (required to be) : implemented in subclasses. Abstract Factory is just one : exmaple, the factory creation method is shared, and products classes : creation methods are abstract. : Common pitfalls: many external resources like DB connection, LDAP connection : , Stream IO, : Socket connection would need expl
|
|