1 marks Questions
● State two ways to create a thread.
● What is synchronization?
● List types of JDBC drivers.
● Which method is used to send cookies to the client from servlet?
● What is the purpose of JSP directives?
● List any two modules of Spring.
● What are the thread priorities?
● Define inter-thread communication.
● State the use of the getConnection() method.
● What is session?
● How to represent expression in JSP?
● What is Spring MVC?
● List any two applications of Spring
● “Spring is lightweight, loosely coupled and open source”. Comment this statement
Java Collections
What is the Map interface? Explain any two methods with their syntax.
What is the Collection interface? Explain any two methods with their syntax.
Explain the difference between
I. ArrayList and LinkedList collections with example.
II. HashSet and TreeSet in Java Collections.
Multithreading
Define inter-thread communication and state any two methods used for it.
Write a short note on the life cycle of a thread.
Explain Synchronization in detail.
Differentiate between synchronized method and synchronized block.
Spring Framework
What is Spring Framework? Explain its advantages.
Explain the architecture of Spring Framework.
What is Spring MVC? Explain its working.
How to validate forms in Spring? Explain with example.
Servlet and jsp
Explain session tracking in Servlets. List any two techniques used for session tracking.
What is a cookie? Explain the working of cookies.
Write a note on JSP Expressions with example.
Explain the JSP life cycle.
JDBC
Differentiate between
I. Statement, PreparedStatement, and CallableStatement in JDBC.
II. execute(), executeQuery(), and executeUpdate() in JDBC.
Programming questions:
JDBC Programs
1. Write a Java program to accept details of Patient (Pid, Pname, P_treatment), store
them into a database and display them.
2. Write a Java program to accept details of Teacher (Tid, Tname, Tsubject), store
them into a database and display them.
3. Consider Student table (RollNo, Name, Class, Address) and write a Java program
using JDBC to display all records from the table.
4. Consider Employee table (EmpId, EName, Designation, Address) and write a Java
program to insert a new record using PreparedStatement.
JSP Programs
5. Write a JSP program to check whether a given number is prime or not.
6. Write a JSP program to accept Name and Age of voter and check whether the voter
is eligible for voting or not.
Servlet Programs
7. Write a Java Servlet program named FormServlet that accepts a user's name from an
HTML form using the POST method and displays the message:
“Hello, [name]! Welcome to Servlet Programming.”
8. Write a Java Servlet program named AddServlet that performs addition of two
numbers.
Java Collection Programs
9. Write a Java program to accept N integers from a user, store them in a LinkedList,
and display only negative integers.
10. Write a Java program to read N names of friends, store them in a TreeSet, and
display them in ascending order.
Multithreading Programs
11. Write a Java program to display name and priority of a thread.
12. Write a Java program using multithreading to display alphabets from 'A' to 'Z'
with a delay of 2 seconds between each character.