• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Interview questions for Java developer, Struts, EJBs

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are a few questions I was asked at a recent interview. Hope somebody finds this helpful in preparing for an interview.

1. What is the difference between, FINAL, finally{} and finalize()?
2. What are weak and strong references?
3. What can an interface do that a 100% abstract class cannot?
3. Why use stateful beans for persistance instead of stateless beans?
4. How are singletons created in a cluster environment?
5. How are JSPs included within JSPs?
6. What does the ReflectionsAPI do?
7. What design patterns have you used?How?
 
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Gina for posting these questions. I didn't know about the weak references. Now got it.

Keep up the good work.

Avi Sinha
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for posting them. It should be useful to us
 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These are great. It was good to review Strong References vs Weak References. I'll bet ignorance of these cause a lot of performance problems.
 
Gina vernon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone have an answer to the following question? I searched the internet but couldn't find anything that specifically addressed this question.

What can an interface do that a 100% abstract class cannot?



Basically, the question was if a developer can get all the functionality of an interface in a 100% abstract class, why even use an interface?

Thanks.
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gina vernon wrote:Does anyone have an answer to the following question? I searched the internet but couldn't find anything that specifically addressed this question.

What can an interface do that a 100% abstract class cannot?



Basically, the question was if a developer can get all the functionality of an interface in a 100% abstract class, why even use an interface?

Thanks.



I think they were looking for:
a class can only extend one abstract class while it can implement any number of interfaces.
 
Gina vernon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim McGuire wrote:
I think they were looking for:
a class can only extend one abstract class while it can implement any number of interfaces.



Yup, mentioned that. But the interviewer wasn't satisfied with the answer.
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gina vernon wrote:Does anyone have an answer to the following question? I searched the internet but couldn't find anything that specifically addressed this question.

What can an interface do that a 100% abstract class cannot?



Basically, the question was if a developer can get all the functionality of an interface in a 100% abstract class, why even use an interface?

Thanks.



if you use interfaces to define a contract, then if you change the interface in future, you have to implement the changes in all the classes which implement the interface.

but in a abstract class, you can add concrete methods without needing to make changes in classes which extend the abstract class, thus if your contract is gonna change too often , you should use a abstract class to have the base contract + any specialized additional contract features.

And about what a interface can do that a 100% abstract class cannot ? its easy, a interface can extend n numbers of other interfaces, which makes it easy to define a contract based on many other smaller contracts.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic