Web programming basics: HTML, DHTML, XML, scripting, Java, servlets and applets. - One Line Questions

1. What is the main difference between `GET` and `POST` methods in HTTP requests, often handled by Servlets? `GET` sends data in the URL, `POST` sends data in the request body.
2. Which HTML tag is used to create a line break? <br>
3. Which tag is used to define the main heading in an HTML document? <h1>
4. Which HTML tag is used to create a form? <form>
5. Which tag is used to create a hyperlink in HTML? <a>
6. Which attribute is used to specify the character encoding for an HTML document? <meta charset='UTF-8'>
7. Which tag is used to create an unordered list in HTML? <ul>
8. Which of the following is NOT a valid HTML tag? <center>
9. Which HTML tag is used to create a paragraph? <p>
10. Which HTML element is used to create a table? <table>
11. Which HTML tag is used to create an ordered list? <ol>
12. What is a Java Applet? A small Java program embedded within a web page
13. What is a script in web programming? A set of commands executed by the web browser or server
14. What does `alt` attribute in an `<img>` tag represent? Alternative text for the image, displayed if the image cannot be loaded
15. In XML, what is a root element? The first element in the document that contains all other elements.
16. Which Java technology is used to create dynamic web pages on the server-side? Servlets
17. What is the primary characteristic of a Java Applet that distinguishes it from a Servlet? Applets run on the client's browser, Servlets run on the server.
18. Which attribute is used to define an inline style in HTML? style
19. Which attribute is used to define a unique ID for an HTML element? id
20. What is a common use case for Java Servlets? Processing form submissions and interacting with databases
21. Which method is typically used by Servlets to handle incoming HTTP requests? service()
22. What does XML stand for? Extensible Markup Language
23. Which attribute is used to specify the URL of an image in the `<img>` tag? src
24. Which attribute specifies the target window for a hyperlink? target
25. What is the fundamental difference between HTML and XML? HTML is for display, XML is for data storage and transport.
26. In XML, what defines the structure and content rules for an XML document? Document Type Definition (DTD) or XML Schema (XSD)
27. What does DHTML typically involve combining? HTML, CSS, and JavaScript
28. What does HTML stand for? HyperText Markup Language
29. Which of the following is a key advantage of using XML for data? It is platform-independent and human-readable.
30. Which of the following is a markup language used for structuring and displaying content on the World Wide Web? HTML
31. Which of the following is a scripting language used for dynamic content generation on the server-side, often alongside Java Servlets? JavaScript
32. Which scripting language is most commonly used for client-side web development? JavaScript
33. What is the process of converting HTML, CSS, and JavaScript code into visual representations on a web page called? Client-side rendering
34. Which of the following is a benefit of using Servlets over traditional CGI scripts? Servlets are more efficient as they run within the server process and avoid process creation overhead.
35. What is a common characteristic of Java Applets that limits their modern usage? They require a specific plugin (like Java Plugin) that is often disabled or unsupported by modern browsers.
36. What is the purpose of the `<head>` section in an HTML document? To define links to external resources and meta-information
37. What is the purpose of the `<img>` tag in HTML? To insert an image
38. What is the purpose of the `<a>` tag in HTML? To create a hyperlink
39. What is the primary purpose of DHTML? To add dynamic and interactive elements to web pages
40. What is the purpose of the `DOCTYPE` declaration in an HTML document? To inform the browser about the HTML version being used
41. What is the purpose of the `title` tag in HTML? To set the title that appears in the browser tab or window.
42. What is the primary role of CSS (Cascading Style Sheets) in DHTML? To control the presentation and layout of HTML elements.
43. What is the primary function of JavaScript in DHTML? To manipulate the Document Object Model (DOM) for dynamic changes
44. What is the main purpose of XML namespaces? To provide a method for qualifying element and attribute names in an XML document, preventing naming conflicts.
45. What is the role of a Web Server in the context of Servlets? To host and run the Servlet container, which manages Servlets.
46. What is the purpose of the `id` attribute in HTML? To assign a unique identifier to an element for scripting or styling.
47. What is the purpose of a Servlet Container? To manage the lifecycle and execution of Servlets and JSPs.
48. In Java Servlets, what is the `HttpServletResponse` object used for? To send data back to the client as a response.
49. What is the role of a Servlet? To process requests and generate responses on the server
50. What is the main advantage of using XML over HTML for data representation? XML allows for custom tags, enabling semantic meaning.