S2 Java Prog Lab16 Set Theory
S2 Java Prog Lab16 Set Theory
B. In the SetTheory class, it should contain methods and three interfaces such as
UnionHelper, IntersectionHelper, SetDifferenceHelper.
▪ unionOperation method that perform union operation on set that return the
result as list of elements of set
▪ display method that output the result of the from the unionOperation method
▪ display method that output the result of the from the intersectionOperation
method
▪ display method that output the result of the from the differenceOperation
method
H. Create a method inside SetTheory class named it union. In this method, please
instantiate the SetUnion inner class and call createSet method of SetTheory class.
After the two sets has been created, please call unionOperation method of
SetUnion to perform union operation and then call display methods of SetUnion
class to display the result.
J. Create a method inside SetTheory class named it setDiff. In this method, please
created an anonymous inner class named it SetDifference by implementing
SetDifferenceHelper and override the two methods of it. After that inside setDiff
method, please call createSet method of SetTheory class. After the two sets has
been created, please call differenceOperation method of SetDifference anonymous
សាកលវ ិទ្យាល័យភូ មិន្ទភំពន េញ Java Programming
មហាវ ិទ្យយល័យវ ិស្វកមម ពោកគ្រូ៖ ពោ ស្ុខជា
ឆ្នំទ្យី២ ឆមាស្ទ្យី២
inner class to perform set difference operation and then call display methods of
SetDifference class to display the result.
K. Add SetTheory to your available menu that allows the user to perform set
operations.
interface interface-identifier{
// interface methods without definition there
Please read more chapter 11 in the book "Java Programming 8th Edition" by Joyce Farrell that I
gave you. If you do not know about operation of set please go to read about union, intersection,