ja3
- Write a JSP program to display the details of Patient (PNo, PName, Address, age,
disease) in tabular form on browser. [15 M]
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
- Write a Java program to create LinkedList of String objects and perform the following:
i. Add element at the end of the list
ii. Delete first element of the list
iii. Display the contents of list in reverse order
import java.util.LinkedList;
public class StringLinkedList {
public static void main(String[] args) {
// Create a LinkedList of String objects
LinkedList<String> list = new LinkedList<>();
// Add elements at the end of the list
list.add("Apple");
list.add("Banana");
list.add("Orange");
// Display the contents of the list
System.out.println("Contents of the list:");
System.out.println(list);
// Delete the first element of the list
String removed = list.removeFirst();
System.out.println("Removed element: " + removed);
// Display the contents of the list in reverse order
System.out.println("Contents of the list in reverse order:");
for (int i = list.size() - 1; i >= 0; i--) {
System.out.println(list.get(i));
}
}
}