Part 1: Theory Questions
1. Differentiate between AWT and Swing.
2. Explain the Java Delegation Event Model (Event Source, Event Object, Event
Listener).
3. What are adapter classes and why are they useful? Provide WindowAdapter as an
example.
4. Explain the purpose and behavior of BorderLayout, FlowLayout, and GridLayout.
5. What is the role of JPanel in building a user interface?
6. What is a WindowEvent? List and explain at least three key methods from the
WindowListener interface.
7. Differentiate between Statement and PreparedStatement.
8. Explain the main steps for executing a JDBC query.
9. Explain the difference between ResultSet and RowSet.
10.What is a disconnected RowSet (like CachedRowSet) and what are its main
advantages?
11.Explain the different types of JDBC drivers (Type 1-4).
12.Explain scrollable and updatable ResultSets.
13.What is a JavaBean? List its main design conventions.
14.Explain Simple, Boolean, and Indexed properties in JavaBeans.
15.Differentiate between Bounded and Constrained properties.
16.What is Introspection and what is the purpose of the BeanInfo interface?
17.What is bean persistence and how is it achieved?
18.Explain the life cycle of a servlet (init, service, destroy).
19.Differentiate between doGet() and doPost() methods.
20.Differentiate between Servlets and JSP.
21.Explain how HttpSession is used for session tracking.
22.Differentiate between [Link]() and [Link]().
23.Explain the three types of JSP scripting elements, describing the syntax for each.
24.What is a JSP directive? Explain the purpose of the page and include directives.
25.What are Cookies and how are they created and added to the response in a servlet?
26.What are Java Web Frameworks? Give two examples and explain their purpose.
27.Explain the RMI architecture, defining the roles of the Client, Server, Stub, Skeleton,
and RMI Registry.
28.What is the role of the remote interface in RMI? List the rules it must follow.
29.Explain marshalling and unmarshalling in the context of a distributed system like
RMI.
30.Differentiate between RMI and CORBA.
31.What is the purpose of the RMI Security Manager?
32.Explain how to draw 2D shapes and display images in Swing.
1
telegram link for answers and more…
Part 2: Practical (Code) Questions
1. Write a complete Java program to create a data entry form using JFrame, JLabel,
JTextField, JRadioButton, ButtonGroup, and JButton. The program should handle a
button click to display the collected data.
2. Write a GUI application that performs a calculation based on user input and events
(e.g., a simple BMI calculator or currency converter).
3. Write a complete Java program to INSERT multiple records into a database table
using PreparedStatement inside a loop.
4. Write a complete Java program to SELECT records from a database table and
display the results on the console using a while loop on the ResultSet.
5. Write a GUI application that connects to a database. The UI should have a text field
for a user to enter an ID and a "Search" button. When clicked, the program should
retrieve the corresponding record from the database and display its details in other
text fields.
6. Write a servlet that processes an HTML form. The servlet should retrieve at least two
parameters from the request, perform a simple operation, and write an HTML
response back to the client.
7. Write a JSP page that uses HttpSession to manage state (e.g., a page hit counter
that increments and displays a count specific to the user's current session).
8. Write a JSP page (the view) and a Servlet (the controller) that work together using
the MVC pattern. The servlet should process a request, set an attribute, and then
forward the request to the JSP for display.
9. Write a complete client-server application using RMI. This must include all four parts:
the Remote Interface, the Implementation class, the Server program, and the Client
program.
2
telegram link for answers and more…