Java code for set...!!!

Ads

 
 

Share on Google+Share on Google+

Pankaj Jain
Java code for set...!!!
0 Answer(s)      5 years ago
Posted in : Java Beginners
Create 2 classes in same package

Product.java

productId, name, price

ProductImpl.java

create a set in this and try to add objects of product. You should write this exercise such that it should not allow the duplicate products to be added into the set(equal productId).

Hint: override equals & hashcode method

Ads
View Answers
Ads









Related Tutorials/Questions & Answers: