Advance Java Questions With Answers 1749286738
Advance Java Questions With Answers 1749286738
1. What is JDBC?
JDBC (Java Database Connectivity) is an API to connect and execute queries with
a database.
connection.
Reusing database connections instead of creating a new one for each request.
9. What is a servlet?
A servlet is a Java class used to handle HTTP requests and responses in a web
application.
GET appends data to URL and is less secure; POST sends data in the body and is
more secure.
Deployment descriptor for a Java web application, used to configure servlets and
filters.
response.sendRedirect("url");
RequestDispatcher.forward(request, response);
forward stays on server, sendRedirect changes URL and makes new request.
2
17. What is a session in Java web app?
A session stores user-specific data during a user interaction with a web app.
JSP (JavaServer Pages) is a technology for developing web pages with dynamic
Instructions to the JSP container, like <%@ page %>, <%@ include %>, <%@
taglib %>.
JSP Standard Tag Library – simplifies JSP code using tags instead of scriptlets.
3
27. What is MVC architecture in Java web?
= flow.
tables.
Hibernate Query Language, similar to SQL but works with entity names and
properties.
dependency injection.
4
36. What is dependency injection?
class.
embedded servers.
All are stereotypes for beans; Service is for business logic, Repository for
An architectural style for building web services using HTTP methods like GET,
5
44. What is JSON and why is it used in REST?
(Spring).
Data Access Object – a pattern to separate persistence logic from business logic.
A tool for documenting and testing REST APIs with a user-friendly UI.