👉 Assignment:
- Create a
Studentclass (id, name, marks). - Implement
Comparable<Student>to sort bymarks. - Store students in an
ArrayList, sort usingCollections.sort(), and print.
✔️ Expected Learning: Natural ordering, compareTo(), sorting with Comparable.
👉 Assignment:
-
Extend previous
Studentexample. -
Write 3
Comparators:- Sort by
name - Sort by
id - Sort by
marksdescending
- Sort by
-
Use
Collections.sort(list, comparator)and test all.
✔️ Learning: Multiple sorting strategies.
👉 Assignment:
- Create a
Bookclass (title, author, price). - Implement
Cloneableand overrideclone(). - Perform shallow copy and show how changes affect both.
- Then implement deep copy (if
Bookcontains another object likePublisher).
✔️ Learning: Shallow vs Deep cloning.
👉 Assignment:
- Create
Employeeclass (id, name, salary). - Serialize object → save to file.
- Deserialize it back → read from file.
- Show what happens when you mark a field
transient.
✔️ Learning: Object persistence, transient keyword.
👉 Assignment:
- Create a
PrintTaskclass that implementsRunnable. - Thread should print numbers from 1–10 with sleep.
- Start multiple threads concurrently.
✔️ Learning: Multithreading basics.
👉 Assignment:
- Create a
FactorialTaskclass implementingCallable<Long>. - Use
ExecutorServicewithFutureto calculate factorial. - Submit multiple tasks and print results.
✔️ Learning: Callable vs Runnable, return values from thread.
👉 Assignment:
- Create a custom
MyArray<T>collection. - Implement
Iterable<T>. - Write your own
Iteratorto traverse elements. - Test with
for-eachloop.
✔️ Learning: Custom collections, iteration mechanics.
👉 Assignment:
- Take
List<Student>→ demonstrate duplicates allowed + ordering. - Convert to
Set<Student>→ remove duplicates. - Use
Map<Integer, String>for student rollNo → name mapping. - Use
Queue<String>for ticket booking system simulation.
✔️ Learning: Collection framework fundamentals.
👉 Assignment:
- Create a class
MyResourceimplementingAutoCloseable. - Inside
close(), print"Resource Closed". - Use it inside try-with-resources block.
✔️ Learning: Resource management.
👉 Assignment:
-
Create a simple RMI project:
- Interface
Calculator(extendsRemote) withadd,submethods. - Implement it on server side.
- Call from client.
- Interface
✔️ Learning: Remote Method Invocation basics.
👉 Assignment:
- Create a custom
ButtonClickListenerinterface extendingEventListener. - Class
Buttonshould register listeners & notify them on click. - Test by adding multiple listeners.
✔️ Learning: Event-driven programming.
👉 Assignment:
-
Create a
List<Employee>. -
Use Stream API to:
- Filter employees with salary > 50k.
- Convert names to uppercase.
- Sort by salary.
- Collect into a new List.
✔️ Learning: Fluent API + Stream operations.
👉 Build a Mini E-commerce System using interfaces:
Productinterface → classesBook,Electronics.Paymentinterface → classesCreditCardPayment,UPIPayment.Discountinterface → different discount strategies.- Use
Comparablefor sorting products by price. - Use
Serializableto save cart state. - Use
Runnablefor sending confirmation emails in background.