PT_Tutorial 3
PT_Tutorial 3
PT_Tutorial 3
Balkumari, Lalitpur
Tutorial-3
Subject: Programming Technology
Program: BECE IV Deadline: 2078 Jestha 3
Chapter 8,9,10 and 11
Note: Submit the soft copy of your work via LMS.
1. Differentiate application with applet. Write a simple applet program that demonstrates the
event handling.
2. What are the five different methods of applet life cycle? Mention the steps involving
conversation of applet to application with suitable example program.
3. Why applet tags are needed to run an applet? Explain the different applet html tags.
4. How do you pass parameters to the applet? Explain with an example.
5. What is event handling? Can we handle event without delegation event model? Explain your
understanding.
6. What is event delegation model? How does it work for event handling in java?
7. Differentiate event source and event listener? Describe different event classes.
8. How ActionEvent is generated? Explain JButton event handling with an example.
9. Which event is generated when you click mouse? Explain mouse event handling mechanism
with suitable programming code in java.
10. What are the sources of an event? Describe different event listener interface of java.awt.event
packages.
11. How swing is differ from AWT? What are the advantages of swing?
12. Explain the mechanism of separating application code with GUI in swing.
13. What is Java servlet? How do you differentiate java applet, java servlet and java server
pages?
14. Why servlet is important in Java? What are the advantages of using servlet in your
application?
15. How multiple clients are handled in java Servlet? Describe its life cycle.
16. What are the necessary environment and interfaces required to develop and run java servlet.
Explain with the help of simple servlet.
17. Why do we need Servlet, ServletRequest and ServletResponse interfaces while developing
java servlet? List the methods defined by each of the above interfaces.
18. Write a java program to demonstrate the way to read parameters from servlet.
19. What is filter in servlet? Write a simple servlet named as AddServlet with the url pattern
/addServlet which gets the two request parameter(num1 and Num2) from jsp page and add
those values and redirect along with summed value to another servlet SquareServlet with url
pattern /sqServlet, which square the summed value and send response to the client.
20. How do you read and write Session information in java servlet? What are the methods
defined by HttpSession interface.
21. How can you exchange information between different servlets? Explain each with suitable
section of code.
22. What are the difference between get and post method? Explain the usages of cookies.
23. What are the advantages of JSP? Explain different Standard Tag Library of JSP.
24. Give the HTML to create a form with two elements: a textbox named FirstName that holds a
maximum of 50 characters, and a Submit button. The form should submit its data to a JSP
program called ProcessName.jsp using the POST method. Also write the ProcessName.jsp to
handle these request.
25. Identify the following JSP tags: <% %>, <%@ %>, <%! %>, <%= %>. Also explain them.
26. Explain the mechanisms of conversion from JSP to Servlet with reference to life cycle
method of servlet and JSP:
27. Why do we need to handle parameters in JSP? Explain with suitable example.
28. What is JDBC? Explain how Java program access the database?
29. What are the types of JDBC drivers? Explain the uses of JDBC driver.
30. Write a JDBC program to input the information of a product [id, name, price, qty] and store
in a table “tbl_product”. [Assume database name yourself]
31. A database “testdb” contains a table “employee” with some records having id, name, post,
salary. Write a java program to display only those employees whose salary is more than
45000.
32. What are the difference between JDBC and ODBC.