public interface I {
int b = 5;
void a();
}
The question was if this declaration is correct. A received the following answer: "No. You need to change it to be correct." Here is what he wrote:
public interface I {
int b = 5;
private void a();
}
The explanation was great: "Instead this method will have visibility only in the package". The next question was about difference between abstract class and interface. The answer makes me smile: "The advantage of abstract class is that I can declare method in it and don't think about it anymore". Imagine how hard is to think about method in all other cases. :) "And why do you ask all these stupid questions? All this is so simple and doesn't matter" - he continued. After that phrase interview was finished.
So, do you want your code to be developed by such guys? If no be aware of crisis. And develop with pleasure...
3 comments:
All of software developers were at this stage at some point. As long as the guy is open to learning, that's ok.. though people that are at this level, but declare themselves as "experienced in Java" are not very often open to learning.
:-) nice
Probably pour guy was just simply saying that he could implement several methods in abstract class and forget about them, while having interface you need to implement all of them in descendant.
Try to understand thoughts of your counterpart in your next interview before laughing him out.
Post a Comment