The document is an answer key for an Advanced Java exam, covering topics such as static vs dynamic websites, servlets, jQuery, JSP, session handling, MIME types, and design patterns. It includes code snippets and definitions for various concepts, as well as comparisons between technologies like JSP and PHP. The structure consists of multiple questions, each with specific answers and examples.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
1 views3 pages
Advanced Java DSEB4 Answers
The document is an answer key for an Advanced Java exam, covering topics such as static vs dynamic websites, servlets, jQuery, JSP, session handling, MIME types, and design patterns. It includes code snippets and definitions for various concepts, as well as comparisons between technologies like JSP and PHP. The structure consists of multiple questions, each with specific answers and examples.
```javascript let input = prompt("Enter input"); if (!isNaN(input)) { alert("Data must be non-numeric"); } else { alert(input.split('').reverse().join('')); } ```
---
### Q6. (5+2+3 = 10 marks)
**(a)** *Singleton Design Pattern*
- Ensures a class has only one instance. ```java class Singleton { private static Singleton instance = null; private Singleton() {} public static Singleton getInstance() { if(instance == null) instance = new Singleton(); return instance; } } ```
**(b)** *this keyword in JS*
- Refers to current object in context.
**(c)** *Timers in JS*
- `setTimeout()`: Executes code after delay. - `setInterval()`: Executes code repeatedly after intervals.
---
### Q7. (3+3+4 = 10 marks)
**(a)** *Multiple Requests in Servlet*
- Only one servlet instance is created. - Multiple threads handle multiple requests.