use java to write code and please use treeset as mentioned in the question Create a class Customer with below attributes: int - id String - name String - dob double - salary String - email int - age Make all the attributes private.Create corresponding getters and setters. Create a constructor which takes all parameters in the above sequence. The constructor should set the value of attributes to parameter values inside the constructor. Create a class CustomerDemo with main method Create a static method sortCustomerOnId in the CustomerDemo class. This method has to take a list of Customer objects and return a TreeSet of Customer objects sorted based on id. Call the above method from the main method
use java to write code and please use treeset as mentioned in the question
Create a class Customer with below attributes:
int - id
String - name
String - dob
double - salary
String - email
int - age
Make all the attributes private.Create corresponding getters and setters.
Create a constructor which takes all parameters in the above sequence. The constructor should set the value of attributes to parameter values inside the constructor.
Create a class CustomerDemo with main method Create a static method sortCustomerOnId in the CustomerDemo class.
This method has to take a list of Customer objects and return a TreeSet of Customer objects sorted based on id.
Call the above method from the main method
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images