Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Java Sample Questions ›› Java Web Development Sample Questions

Technical Java Sample Questions : Java Web Developement Sample Questions

  1. Can we use the constructor, instead of init(), to initialize servlet?

    Answer: Yes , of course you can use the constructor instead of init().Theres nothing to stop you.But you shouldnt.The original reason for init() was that ancient versions of Java couldnt dynamically invoke constructors with arguments, so there was no way to give the constructur a ServletConfig.That no longer applies, but servlet containers still will only call your no-arg constructor.So you wont have access to a ServletConfig or ServletContext.

  2. How can a servlet refresh automatically if some new data has entered the database?

    Answer: You can use a client-side Refresh or Server Push.

  3. The code in a finally clause will never fail to execute, right?

    Answer: Using System.exit(1); in try block will not allow finally code to execute.

  4. How many messaging models do JMS provide for and what are they?

    Answer: JMS provide for two messaging models, publish-and-subscribe and point-to-point queuing.

  5. What information is needed to create a TCP Socket?

    Answer: The Local System?s IP Address and Port Number.And the Remote Systems IPAddress and Port Number.

  6. What Class.forName will do while loading drivers?

    Answer: It is used to create an instance of a driver and register it with the DriverManager.When you have loaded a driver, it is available for making a connection with a DBMS.

  7. How many JSP scripting elements are there and what are they?

    Answer: There are three scripting language elements: declarations, scriptlets, expressions.

  8. In the Servlet 2.4 specification SingleThreadModel has been deprecated, why?

    Answer: Because it is not practical to have such model.Whether you set isThreadSafe to true or false, you should take care of concurrent client requests to the JSP page by synchronizing access to any shared objects defined at the page level.

  9. Why does JComponent have add() and remove() methods but Component does not?

    Answer: because JComponent is a subclass of Container, and can contain other components and jcomponents.

  10. How can I implement a thread-safe JSP page?

    Answer: You can make your JSPs thread-safe by having them implement the SingleThreadModel interface.This is done by adding the directive ‹ %@ page isThreadSafe="false" % › within your JSP page

Next »

Java web Development Sample Question Number : 1-10| 11-20| 21-23
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.