6.5 million software developers and still going strong

Java Developer Magazine

Subscribe to Java Developer Magazine: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Java Developer Magazine: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Java Developer Authors: Stackify Blog, Douglas Lyon, Glenda Sims, APM Blog, Pat Romanski

Related Topics: Java EE Journal, Java Developer Magazine

J2EE Journal: Article

Secrets Of The Masters: Core Java Job Interview Questions

JDJ Enterprise Editor Yakov Fain Offers 30 Core Java Questions You Might Expect During Job Interviews

 

For senior-level developers:

** Q21. What's the difference between a queue and a stack?

A. Stacks works by last-in-first-out rule (LIFO), while queues use the FIFO rule
** Q22. You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?

A. Sometimes. But your class may be a descendent of another class and in this case the interface is your only option.
** Q23. What comes to mind when you hear about a young generation in Java?

A. Garbage collection.
** Q24. What comes to mind when someone mentions a shallow copy in Java?

A. Object cloning.
** Q25. If you're overriding the method equals() of an object, which other method you might also consider?

A. hashCode()
** Q26. You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use:
ArrayList or LinkedList?

A. ArrayList
** Q27. How would you make a copy of an entire Java object with its state?

A. Have this class implement Cloneable interface and call its method clone().
** Q28. How can you minimize the need of garbage collection and make the memory use more effective?

A. Use object pooling and weak object references.
** Q29. There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it?

A. If these classes are threads I'd consider notify() or notifyAll(). For regular classes you can use the Observer interface.
** Q30. What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access it?

A. You do not need to specify any access level, and Java will use a default package access level.

The J2EE questions are coming soon. Stay tuned for Yakov Fain on Live SYS-CON.TV. Ask your questions to Yakov on the air!

More Stories By Yakov Fain

Yakov Fain is a Java Champion and a co-founder of the IT consultancy Farata Systems and the product company SuranceBay. He wrote a thousand blogs (http://yakovfain.com) and several books about software development. Yakov authored and co-authored such books as "Angular 2 Development with TypeScript", "Java 24-Hour Trainer", and "Enterprise Web Development". His Twitter tag is @yfain

Comments (176) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
rajasekhar 04/30/06 11:56:34 PM EDT

I am a 2+ years experience candiate in java please give me suggestions of how to prepare for the interview

AB Iyer 04/29/06 03:25:15 PM EDT

Please send me some java /j 2ee questions

Jitendra Pant 04/27/06 04:21:43 PM EDT

Give me interview Questions on Core Java, JSP,JDBC that usually asked to 1-2 years exp. people.Very urgent.

aravind 04/21/06 12:39:21 AM EDT

hi i m looking for the job.i needed question regarding corejava and j2ee related topics.plz help me.
thanks

Md. Farid Khan 04/17/06 08:36:38 AM EDT

I am currently working on JAVA/J2EE struts.
so i desparately need questions from the above topics.
Plz help

jhgeer 04/10/06 03:11:45 AM EDT

fsdfsdf

Chakrapani Panda 03/31/06 03:08:46 AM EST

Please give me some core java and swing interview question.

amit r ambre 03/16/06 04:23:33 AM EST

amit

amit r ambre 03/16/06 04:23:29 AM EST

amit

amit r ambre 03/16/06 04:14:43 AM EST

Amit

amit r ambre 03/16/06 04:14:41 AM EST

Amit

Padmanabhan G 02/18/06 01:07:45 PM EST

I need the type of questions asked in java/j2ee in interview for Freshers

Nitin 02/09/06 12:49:52 AM EST

Thanx Jack

jack 02/07/06 09:27:13 PM EST

You can get good java interview questions for freshers in the following link.

http://www.geocities.com/srcsinc/interview_questions/java_interview_ques...

Nitin Tyagi 02/07/06 02:51:51 AM EST

Dear friends,
I need the type of questions asked in Core java/j2ee in interview for 1+ year experience.
please send me to my email-id

sravya 02/06/06 02:36:03 AM EST

Dear frnds,
I am applying for jobs with 2+ experience.I Want to know how the interviewer may ask the questions related to real time experience..Can anyone suggest few questions which can show that how deapth they may question on Servlets/JSP/Struts/RMI and EJB

Mukesh 02/02/06 01:36:07 AM EST

hi,
i in need of inteview questions of corejava,servlets,jdbc,jsp

Sujit Singh(NIIT-Malleswaram) 01/08/06 03:02:29 PM EST

Dear friends,
I need the type of questions asked in java/j2ee in interview for 1+ year experience.
please send me to my email-id

suresh 01/06/06 10:15:33 AM EST

respected sir,
i am in need of interview questionpapers for corejava,servlets,jsp,jdbc.please send me to my email-id

suresh 01/06/06 10:06:08 AM EST

hi,
i in need of inteview questions of corejava,servlets,jdbc,jsp

sujit Singh 01/01/06 12:15:28 PM EST

Hi,i want the 1 to 5 experience java questions

Arun Kumar 12/29/05 12:16:29 AM EST

Hi, I need some sample questions Regarding Jcp Exam

karthik 12/19/05 05:20:21 AM EST

I need some basic core java,servlets,jsp and structs question,kindly help me.

akash 12/17/05 08:52:52 AM EST

I need Core JAVA and J2ee Interview Questions.

monalisa sahoo 12/09/05 11:09:09 AM EST

i want the 1 to 5 experience java questions.

Yakov Fain 11/04/05 04:43:40 PM EST

Dear friends,

These are all questions I was planning to publish at this point. Unfortunately, most of the feedback I've received so far started with the words "Give me", "I want", "I had required"... I understand that English is not your first language (so as mine), but such requests just sound rude.
Anyway, if you'd like to provide some feedback, be my guest, but it has to be a constructive one. I'm planning to publish another set of non-core Java questions soon. When? I do not know, whenever I'll have a bit more time.

All the best,
Yakov

sudhanu sekhar swain 11/04/05 01:48:34 PM EST

I had required a servlet/core java/jsp/ejb/struts question. if possible please send to my id.

sudhansu sekhar swain 11/04/05 01:44:33 PM EST

hi , i am sekhar working on java tech since 2004 .

Hemantha Kumar 11/04/05 02:38:14 AM EST

I had required a servlet/core java/jsp question. if possible please send to my id.

rakesh kumar 10/28/05 05:24:06 AM EDT

i want some java questions from JCP exam

rakesh kumar 10/28/05 05:24:01 AM EDT

i want some java questions from JCP exam

liming 10/20/05 05:02:32 PM EDT

I wan to see the questions

Ashish Chiwhane 10/19/05 05:07:58 AM EDT

Hi,
I would appreciate if someone pls send me java,j2ee interviews que and ans.
Thanks in advance...

Sarbajit 10/14/05 04:02:35 AM EDT

Hi,
I want the corejava,jsp,servlet, awt ,swing interview questions.

Shankar 10/12/05 10:13:13 AM EDT

Hai i need the java interview questions, i want to prepare for myself for an interview so it may be useful.

kumaravelu 10/09/05 10:18:05 AM EDT

Give me interview Questions on Core Java, JSP,JDBC that usually asked to 1-2 years exp. people.Very urgent.

kumaravelu 10/09/05 10:18:01 AM EDT

Give me interview Questions on Core Java, JSP,JDBC that usually asked to 1-2 years exp. people.Very urgent.

madhav 09/27/05 11:46:11 AM EDT

i saw quiet a post in your website asking for the java technical interview questions and answers.Are you really sending them ? if yes, i would also like to get a copy of it. Thanks in advance

shruti kondreddi 09/27/05 08:41:56 AM EDT

thanks.

Akshay's Notebook 09/26/05 05:22:30 PM EDT

Trackback Added: Decent Java Interview Questions; So generally I'm against asking code specific questions during an interview. You can tend to weed out really good developers who just happen to be rusty in a particular area. This article over at JDJ (Secrets Of The Masters: Core Java Interview Quest...

sudhansu.swain 09/24/05 05:13:20 PM EDT

i want to java interview question

ketaketi 09/20/05 11:15:06 AM EDT

i saw quiet a post in your website asking for the java technical interview questions and answers.Are you really sending them ? if yes, i would also like to get a copy of it. Thanks in advance.

JDJ News Desk 09/17/05 09:24:23 AM EDT

Secrets Of The Masters: Core Java Interview Questions. If you are planning to hit the job market, you may need to refresh some of the Java basic terms and techniques to prepare yourself for a technical interview. JDJ Enterprise Editor Yakov Fain here offers thirty of the core Java questions that you might expect during the interviews, 20 for mid-level developers and the final ten for senior-level developers. Why not try them and see how well you do?

JDJ News Desk 09/17/05 08:31:07 AM EDT

Secrets Of The Masters: Core Java Interview Questions. If you are planning to hit the job market, you may need to refresh some of the Java basic terms and techniques to prepare yourself for a technical interview. JDJ Enterprise Editor Yakov Fain here offers thirty of the core Java questions that you might expect during the interviews, 20 for mid-level developers and the final ten for senior-level developers. Why not try them and see how well you do?

anwarbasha 09/13/05 03:54:14 PM EDT

plz send me java interview questions. i desparately in need of them

Ashish Chiwhane 09/08/05 05:47:56 AM EDT

Hi,
I want the corejava,jsp,servlet,ejb and struts interview questions.

kuldeep kumar 09/01/05 07:27:19 AM EDT

Hi,
I want the corejava,jsp,servlet,ejb and struts interview questions.

Hoshiar Singh 08/27/05 03:43:57 AM EDT

Hi
The questions for Senior Level were Interesting. Thanx

bandita 08/26/05 11:59:33 PM EDT

Hi,
I want the corejava,jsp,servlet,ejb and struts interview questions.

Sailaja 08/16/05 01:53:52 AM EDT

Too good questions. Waiting eagerly for the J2EE questions. It would be better to post some more questions and answers of Core Java.