CIS 135: Exam 4 Answers


The answers to all but one of the questions could be  found in the lecture notes as posted as of May 7, 2002.
Nbr Acceptable Answer(s) See Lecture Question
1. getDocumentBase() 24 What method of Applet would you use to get the URL for where an HMTL file sits?
2. getCodeBase() 24 What method of Applet would you use to get the URL for where a class file sits?
3. getAudioClip() 23 What method of Applet would you use to get an audio clip that will be displayed in an Applet?
4. URL 23 What is the data type for the first argument for the method in question 3?
5. String 23 What is the data type for the second argument for the method in question 3?
6. newAudioClip() 23 What method of Applet would you use to get an audio clip that will be displayed in an Application?
7. URL 23 What is the data type for the first argument for the method in question 6?
8. NA 23 What is the data type for the second argument for the method in question 6?
9. Get 22 What method of an HTML form limits the amount of information that can be passed to the server?
10. request
HttpServletRequest
22 What object of Servlet contains all information sent to the server from the browser?
11. response
HttpServletResponse
22 What object of Servlet contains all information to be sent back to the browser?
12. PrintWriter X What is the data type of the Servlet "out" object?
13. RequestDispatcher 22 What class is used to forward a request/response to another process (as shown in lecture)?
14. getRequestDispatcher() 22 What method of the Servlet "request" object returns an object of the type from question 13?
15. Session
HttpSession
22 What class is used to set or get attributes?
16. getAttribute() 22 What method of the Servlet "request" object returns an object of the type from question 15?
17. setAttribute() 22 What method of the class from question 15 sets an attribute?
18. String 22 What is the data type for the first argument for the method in question 17?
19. Object 22 What is the data type for the second argument for the method in question 17?
20. MediaTracker 23 What class is used to monitor the loading of images or audio clips?
21. Graphics 23 What class contains the methods for drawing an image?
22. Toolkit 23 What class is required in order to create images for an Application?
23. getToolkit() 23 What method returns an object of the type from question 22?
24. createImage() 23 What method of the class from question 22 creates an image?
25. URL 23 What is the data type of the first argument for the method named in question 24?