|
|
Interview Questions
|
Java Interview questions part 5
Part 1 |
Part 2 |
Part 3 |
Part 4 |
Part 5 <<Previous
Next>>
Question - What is preinitialization of a servlet?
Answer
The process of loading a
servlet before any request comes in is called preloading or preinitializing a
servlet. Normally, a container doesn't initialize the servlets as it starts up,
it initializes a servlet when it receives a request for that servlet first
time.
Question - What is the difference between JSP and Servlets?
Answer
JSP supports only HTTP protocol. But a servlet can support any
protocol like HTTP, FTP, SMTP etc.
Question - What is the difference between Difference between doGet() and
doPost()?
Answer
GET Method: All data we are passing to Server will be displayed in
URL. Here we have size limitation.
POST Method: In this method we don’t have any size limitation. All data passed
to server will be hidden; User cannot able to see this info on the browser.
Question - What's the difference between servlets and applets?
Answer
Servlets executes on Servers while Applets executes on browser.
Unlike applets, servlets have no graphical user interface.
Question - What is JSP?
Answer
JSP is a technology that returns dynamic content to the Web client
using HTML, XML and JAVA elements. JSP page looks like a HTML page but is a
servlet. It contains Presentation logic and business logic of a web
application.
Question - What is the purpose of setAutoCommit do?
Answer
A connection is in auto-commit mode by default which means every SQL
statement is treated as a transaction and will be automatically committed after
it is executed. If you want all statements not to be committed until you call
the method commit explicitly, you need to disable auto-commit mode.
con.setAutoCommit(false);
Part 1 |
Part 2 |
Part 3 |
Part 4 |
Part 5
|
|
|
|
|