Starting from:

$34.99

OOP Day 4: Assignment- Collection & Exception Handling Solution

Create a mini java application as following.
→ Create following beans with properties
Address (city, state, pinCode)
Student (id, name, marks, section, Address)
→ Create a Service implementation class having following operations. Use interface for template and then concrete class service implementation.
addStudent() - This method should add provided student object on collection (choose the collection as best fit List/LinkedList). Student id should be randomly generated and method should return it bundled with student object.
deleteStudent() - This should take studentId in input and remove that associated student object from collection findStudent() - This method should return student based on provided studentId findStudentWithPincode() - This method should take city pincode as input and should return collection of students with that address sortWithName() - define a method which should return collection of sorted student with respect to name setOfMarks() - define a method which should return collection of unique marks obtained by all students (duplicates should be omitted) addAllStudents() - define a method which should take collection of Student object in parameter and add them in available collection of students. This method should also maintain the order of students with respect to obtained marks.
Hint: Use switch-case for performing operations from command line (i.e. press 1 to add student, 2 for deleting etc.) Use collections sorting, comparator/comparable for object
Day 4: Assignment- Collection & Exception Handling 1
comparison.
NOTE: The above assignment focuses on following concepts..
Collection List, LinkedList, Map, Set
Add, Delete, Find operations on collections
Sorting and searching
Object comparison
Practice of methods available in Collections class
How to convert from one to another type of collection based on requirement Use of Comparator and Comparable

Answer the following interview questions
Ques 1: How to convert a Array into ArrayList and vice-versa? Write example code snippet
Ques 2: Why collections are used in java if everything can be implemented using Array?
Ques 3: What are fail-fast and fail-safe collection iterations
Ques 4: Difference between Iterator and ListIterator
Ques 5: Explain the real situation use of HashMap, HashSet and LinkedList collections
Day 4: Assignment- Collection & Exception Handling 2

More products