Medium Answer Questions

Medium Answer Questions

Unit 1: Core Java & OOP
21. Differentiate between class and interface with examples.
22. Explain Java Collections and their role in web development.
23. Explain object-oriented principles used in web application design.
24. Write a Java program to compare two strings.
25. Write a Java program to swap two numbers.

Unit 2: JDBC & Database Connectivity
26. Differentiate between Type-1 and Type-2 JDBC drivers.
27. Explain DDL and DML operations and how JDBC supports them.
28. Differentiate between ResultSet and RowSet.
29. Write JDBC code using PreparedStatement to insert records into a table.
30. Explain handling of null values in PreparedStatement.

Unit 3: Servlets
31. Explain the Servlet life cycle.
32. How does a Java class become a Servlet?
33. Explain advantages of Servlets over CGI.
34. Explain HTTP methods used in Servlets with examples.
35. Explain ServletConfig and ServletContext.
36. Explain session tracking techniques in Servlets.
37. Explain session timeout in web applications.

Unit 4: Java Server Pages (JSP)
38. Explain JSP life cycle.
39. Explain JSP exception handling with example.
40. Explain JSP directives with example.
41. What is a Custom Tag Library? Explain JSTL.

Unit 5: Spring Framework
42. Explain Dependency Injection technique.
43. Differentiate Constructor Injection and Setter Injection.
44. Explain Spring annotations used in web development.
45. Explain the front controller (DispatcherServlet) in Spring MVC.

Unit 6: Hibernate
46. Explain Object Relational Mapping (ORM).
47. Explain how ORM is implemented using Hibernate.
48. Explain advantages of Hibernate.
49. Explain HQL clauses: FROM, SELECT, WHERE, GROUP BY, ORDER BY.

Unit 7: Modern Java Features
50. Explain Java Lambda expressions and their usage.
51. Explain Java Stream map() function with example.
52. Explain rewriting technique and its advantages and disadvantages.