It seems to me that you may have had an incompetant interviewer.
The real answer to your question is:
"Java is not the same as Java Script."
If the company doing the interviewing is interviewing for a Java programmer position then the above answer should suffice. The interview should really concentrate on the Java langauge. A good guide for Java interview questions is the
SCJP exam requirements.
If the interviewier is hiring for a Java position but keeps hammering you about JavaScript then he/she is an incompetant bozo and you do not want to work there.
My point being - you are a Java programmer - not a JavaScript programmer. It's like asking me to describe the differences between Prolog and Java. Yes they are different - now can we please move onto another subject (I would be thinking this).
Another way to
test interviewers - ask for a business card. The serious ones - the ones who are really serious about making a hiring decision will have one. It's a great way to judge whether the company is doing a dog and pony show or is serious about making a hiring decision. Try it sometime - seems to work about 90% of the time - especially with on campus college interviewers and getting called in for a second interview.
Now - getting back to the Java technical interview: Here is an all time classic Java interview question - and it comes up at almost every Java technical interview.
Describe the differences between private, friendly, protected and public classes.
Response: You can either babble for 15 minutes or you can go to the white-board and draw out the classic access modifier chart. Simple/Concise/Effective. And if there is any follow up - you can always refer to the chart you just wrote on the board.
This response tells the employer several things:
1. You have some knowledge about Java. At least you know about access modifiers.
2. You can communicate effectively and clearly.
3. You have a take charge attitude and are not afraid to take control of the situation.
4. It tells me a lot more than a JavaScript vs. Java question. See my point here.
I am not saying you need to charge in there like a bull in a china shop - but this is a classic case of where you can take control of the situation. And hey, throw in a smile to relax the interviewer. Ask - "Do you have any questions?" It would be utterly beautiful if the interviewer then asked you to followup by giving an example using modifiers and you pulled one of the Java Exam question/answers out of your head and put that on the board as well. Do this, and you will beat out 90% of the other candidates who just sit there and babble and squirm in their little seats.
Think I am wrong...try it sometime. Want another opinion, try sitting in the interviewer's chair.
I have often said that the best way to be a waiter is to be a customer first. The same applies to being a good job candidate. Think about it.
Bonus: The access/modifier question comes up
alot (in the form of deciding what certain code examples can/cannot do) during the SCJP exam.
Hope this helps.
John Coxey
(jpcoxey@aol.com)
[This message has been edited by John Coxey (edited January 20, 2001).]
[This message has been edited by John Coxey (edited January 20, 2001).]