Servlets Interview Questions
Posted by admin on Monday Feb 14, 2011 Under JOB FINDER

Pls help… Answers to java interview questions..?
Dear friends, below are the interview questions asked ina technical interview in one of the leading IT firm. Pls help me with ans for the below qns…. Thanks in Advance
1) As a developer, What do u see as a advantage/ difference bet. using JSP & Servlets and using Struts or other framework?
2) What id the difference bet “==” and “.equals()”.
3) What is result – will the condition pass(pls ignore the syntax error)
int i = new int(1);
Long l = new Long(1);
1) if (i==j) { }
2) if (i.equals(j) { }
3) if (i.ignorecasej) { }
4) Difference bet Set and Map
5) There are 100 strings. all must be joined as a single string. wat are the methods to achive it?
6) Can u use struts in a Spring application? if yes, wat makes it possible?
I’ll answer some of them.
1. The advantage of using Struts is that it gives you some functionality out of the box that JSP and Servlets do not. Struts is based on the MVC pattern and, if used properly, makes separation of UI and logic easier. Using the Tiles plugin in Struts makes building pages much easier than JSP and Servlets. The disadvantage of any framework is the learning curve. They are more complex that just JSPs and Servlets. Regardless of which you use (framework or JSP/Servlets), you need to use both correctly to get any benefit. If you put all of your logic in the Action class or in the Servlet, your app will work, but be harder to extend and maintain.
2. On objects, == determines if the 2 objects are of the same type. equals() usually looks at the internal value(s) of each object. equals() can also be overridden so you can get the exact comparison you need for your object.
3. Write the code and see for yourself.
4. Map is for storing key/value pairs. Set is a collection of unique elements.
5. StringBuilder.append()
6. Yes, you can. Spring is based on POJOs which can be used anywhere. The latest version of Struts has the Action class as a POJO, so it is easy to inject a Spring controlled object into the Action.
Interview Questions on Java And JEE Video
|
|
Advanced JAVA Interview Questions You’ll Most Likely Be Asked $14.32 Advanced JAVA Interview Questions You’ll Most Likely Be Asked is a perfect companion to stand ahead above the rest in today’s competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver’s seat and helps them steer th… |
|
|
Practical Guide to Last Minute Java and JEE Technology interview questions This guide provides variety of questions that are asked during Java and JEE technologies interviews to experienced developers, designers, architects and managers. This guide does not provide an exhaustive number of questions, but works as a refresher guide for revision of question / answers…. |
|
|
JSP-Servlet Questions You’ll Most Likely Be Asked (Job Interview Question Series) $9.99 JSP-Servlet Interview Questions You’ll Most Likely Be Asked is a perfect companion to stand a head above the rest in today’s competitive job market. Rather than going through comprehensive, textbook-sized reference guides, this book includes only the information required immediately for job search to build an IT career. This book puts the interviewee in the driver’s seat and helps them steer their… |