0% found this document useful (0 votes)
2 views

Advance Java Index

Advance Java Program List

Uploaded by

katha.sagar000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Advance Java Index

Advance Java Program List

Uploaded by

katha.sagar000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Roll No:___________________

INDEX
MCAL 12 Advance Java Lab

S.No. Problem Statement Date Course Faculty


Outcome Signature

Category 1: Java Generics


1. Write a Java Program to demonstrate Wildcards in Java Generics
2. Create a generic method to sort an array of any data type using a sorting
algorithm like bubble sort.
3. Create a generic method to sort an array of any data type using a sorting CO1
algorithm like quicksort.
4. Create a generic stack class that supports push, pop, and peek operations
for different data types.
5. Implement a generic class that represents a pair of values. Write a method
to swap the values in the pair.
6. Implement a generic class that represents a pair of values. Write a method
to swap the values in the pair.
7. create a generic interface called Container, which allows for basic
operations like adding and getting items.
8. Write a Java program to create a generic method that takes two arrays of
the same type and checks if they have the same elements in the same order. CO1
9. Write a Java program to create a generic method that takes a list of
numbers and returns the sum of all the even and odd numbers.
10. Write a Java program to create a generic method that takes two lists of the
same type and merges them into a single list. This method alternates the
elements of each list
Category 2: List Interface
11. Write a Java program to create List containing list of items of type String
and use for- -each loop to print the items of the list.
12. Write a Java program to create List containing list of items and use List
Iterator interface to print items present in the list. Also print the list in
reverse/backward direction.
13. Write a Java program to implement list interface through any of the class
for the following task
iterate through all elements in an array list.
Insert an element into the array list at the first position.
retrieve an element (at a specified index) from a given array list.
To update an array element by the given element CO1
14. Write a Java program to implement list interface
 iterate through all elements in a linked list starting at the specified
position.
 to convert a linked list to an array list.
 to compare two linked lists.
to shuffle elements in a linked list.
15. Student Grades Management System using LinkedList
 - Create a `Student` class with fields like `name`, `studentId`, and
`grade`.
 - Use a `LinkedList` to store student records.
Roll No:___________________
 - Add functionality to add, remove, and search for a student by
`studentId`.
 - Iterate through the list to calculate and display the average grade
16. Implement a Task Manager using ArrayList
 - Create a `Task` class with fields like `title`, `description`, and `priority`.
 - Use an `ArrayList` to store tasks.
 - Implement operations to add, remove, and display tasks.
 - Sort tasks based on priority and display them.
Category 3: Set Interface
17. Write a Java program to create a Set containing a list of items of type String
and print the items in the list using the Iterator interface. Also, print the
list in the reverse/backward direction.
18. Write a Java program to perform the sort method in set interface.
19. Write a Java program using Set interface containing list of items and
perform the following operations:
a. Add items in the set. CO1
b. Insert items of one set in to other set.
c. Remove items from the set
d. Search the specified item in the set
20. Write a Java program to implement a set interface
 convert a hash set to a List/ArrayList.
 to clone a hash set to another hash set.
 to compare two sets and retain elements that are the same in new set.
21. Write a Java program to implement set interface
 to add all the elements of a specified tree set to another tree set.
 to create a reverse order view of the elements contained in a given
tree set.
CO1
 to get the first and last elements in a tree set.
 to get the element in a tree set that is greater than or equal to the given
element.
 to retrieve and remove the last element of a tree set.
22. Voting System using HashSet
 Create a `Voter` class with fields like `voterId` and `name`.
 Use a `HashSet` to store voter IDs that have already voted.
 When a new vote comes in, check if the voter ID is in the `HashSet`.
 If not, allow voting and add the voter ID to the `HashSet`.
 If it exists, prevent voting and display a message saying the voter has
already voted.
23. Company Org Chart using TreeSet
 Create an `Employee` class with fields like `id`, `name`, and CO1
“position`.
 Use a `TreeSet` to store employees, ensuring they are stored in
alphabetical order by name.
 Display the organizational chart in order.
24. Shopping Wishlist using LinkedHashSet
 Use a `LinkedHashSet` to store items in a shopping wishlist.
 Add items to the wishlist in the order they are added.
 Allow removal of items, and display the wishlist to the user
Category 4: Map Interface
Roll No:___________________
25. Write a Java program using Map interface containing list of items having
keys and associated values and perform the following operations:
a. Add items in the map.
b. Remove items from the map
c. Search specific key from the map
d. Get value of the specified key
e. Insert map elements of one map into other map.
f. Print all keys and values of the map.
26. Write a Java program to copy all mappings from the specified map to
another map.
27. City Distance Finder using HashMap
CO1
o Use a `HashMap` where the key is a city name and the value is its
distance from a reference point (e.g., your current location).
o Add multiple cities and their distances.
o Retrieve and display the distance for a specific city when searched.
o Display all cities within a certain distance.
28. Employee Directory using LinkedHashMap
o Create an `Employee` class with fields like `id`, `name`, and
`department`.
o Use a `LinkedHashMap` to store employees, ensuring they are displayed
in the order they were added.
o Add operations to add, remove, and search for an employee.
o Display all employees in insertion order
29. Write a Java program to test if a map contains a mapping for the specified
value.
CO1
30. Write a Java program to associate the specified value with the specified
key in a Tree Map.
31. Write a Java program to search for a value and key in a Tree Map.
Category 5: Lambda Expression
32. Write a Java program using Lambda Expression to print” Hello World”. CO1
33. Write a Java program using Lambda Expression with single parameters. CO1
34. Write a Java program using Lambda Expression with multiple parameters
CO1
to add two numbers.
35. Write a Java program using Lambda Expression to calculate the following:
a. Convert Fahrenheit to Celsius CO1
b. Convert Kilometers to Miles.
36. Write a Java program using Lambda Expression with or without return
CO1
keyword.
37. Write a Java program using Lambda Expression to concatenate two
CO1
strings.
Category 6: web application development using JSP
38. Write a JSP program that demonstrates the use of JSP declaration,
CO2
scriptlet, directives, expression, header and footer.
39. Design loan calculator using JSP which accepts Period of Time (in years)
and Principal Loan Amount. Display the payment amount for each loan
and then list the loan balance and interest paid for each payment over the
CO2
term of the loan for the following time period and interest rate:
a. 1 to 7 year at 5.35%
b. 8 to 15 year at 5.5%
Roll No:___________________
c. 16 to 30 year at 5.75%
40. Create a Telephone directory using JSP and store all the information
within a database, so that later could be retrieved as per the requirement. CO2
Make your own assumptions.
41. Write a JSP page for the Login form without the database. CO2
42. Write a JSP page for the Login form with the database. CO2
43. Write a JSP page to display the Registration form (Make your own CO2
assumptions)
44. CRUD Application (JSP + Servlet + Bean + Database) CO2
o Problem Statement:
 A JSP page to list users or products.
 Servlets to handle CRUD operations (e.g., adding, updating, deleting
items).
 Use JavaBeans for handling the data model (e.g., UserBean,
ProductBean).
 Use JDBC to connect to a relational database like MySQL.
 Implement form validation and error handling.
45. User Registration and Login System (JSP + Servlet + Bean) CO2
 Problem statement: Implement a user registration system and login form
with JavaBeans.
 Use JSP pages for user interaction (registration/login).
 A servlet that handles login and registration logic.
 JavaBeans to represent user data (name, email, password).
 Store user data in session or database (using JDBC or an in-memory
list).
 Validate user credentials for login.
46. Employee Leave Management System (JSP + Servlet + Bean + CO2
Database) Problem statement: Build an employee leave management
system to allow employees to apply for leaves and track leave statuses.
 Employee login system (use Servlets for authentication).
 Apply for leave (use forms with JSP).
 Admin panel for approving/rejecting leave requests.
 Display leave status (approved, pending, rejected).
 Use JavaBeans to represent leave details and employee
information.
 Store leave data in a database.
47. Write a JSP program to add, delete and display the records from CO2
StudentMaster (RollNo, Name, Semester, Course) table.
Category 7: Spring Framework
48. Write a program to print “Hello World” using spring framework. CO3
49. Write a program to demonstrate dependency injection via setter method.
50. Write a program to demonstrate dependency injection via Constructor. CO3
51. Write a program for the calculator to demonstrate dependency injection
CO3
via Constructor.
52. Injecting Collections
1. Create a Restaurant class with a List of String to represent menu items.
2. Use Spring to inject the menu items into the Restaurant class. CO3
3. Configure the list in XML or using annotation configuration.
4. Print the menu items in the test class.
53. Constructor Injection CO3
Roll No:___________________
1. Create a class Engine with a method start() that prints "Engine started".
2. Create a class Car that has a dependency on Engine. 3. Use constructor
injection to inject the Engine into the Car class.
4. Configure the beans in the Spring XML configuration file or using Java-
based configuration.
5. Write a test class to retrieve the Car bean from the Spring container and
call its start() method.
54. Setter Injection
1. Modify the above example to use setter injection instead of constructor
injection.
CO3
2. Add a method setEngine() in the Car class for dependency injection.
3. Configure the beans using XML or annotations for setter injection.
4. Test the application
Category 8: Aspect Oriented Programming
55. Write a program to demonstrate Spring AOP – before advice.
56. Write a program to demonstrate Spring AOP – after advice. CO4
57. Write a program to demonstrate Spring AOP – around advice.
58. Write a program to demonstrate Spring AOP – after returning advice.
59. Write a program to demonstrate Spring AOP – after throwing advice. CO4
60. Write a program to demonstrate Spring AOP – point cuts.
Category 9: Spring JDBC
61. Write a program to insert, update and delete records from the given table.
CO5
62. Write a program to demonstrate Prepared Statement in Spring
JdbcTemplate
63. Write a program in Spring JDBC to demonstrate the Result Set Extractor
Interface
CO5
64. Write a program to demonstrate Row Mapper interface to fetch the records
from the database.
Category 10: Spring Boot
65. Write a program to create a simple Spring Boot application that prints a
CO6
message.
66. Write a program to demonstrate RESTful Web Services with Spring Boot. CO6

You might also like