Question: follow exact format of 2nd photo. IN JAVA Implement a class, called Combination, to store three integer values (ints). 1. declare the necessary instance variables

 follow exact format of 2nd photo. IN JAVA Implement a class,called Combination, to store three integer values (ints). 1. declare the necessary

follow exact format of 2nd photo. IN JAVA

Implement a class, called Combination, to store three integer values (ints). 1. declare the necessary instance variables to store the three integer values; 2. create a constructor, public Combination(int first, int second, int third), to initialize the values of this object. constructor, given the following: Combination c1,c2,c3; c1= new Combination (1,2,3); c2= new Combination (1,2,3) c3= new Combination (3,2,1) then c1.equals(c2) is true but c1.equals(c3) is false; 4. finally, implement the method public String toString(), to return a String representation of this object, where the first, second and third values are concatenated and separated by ":" symbols. E.g. Combination c1; c1 = new Combination (1,2,3); System.out.println(c1); displays "1:2:3". The interface of the class Combination consists therefore of its constructor, the method equals and the method toString. Note: Simpler code is better and it is worthwhile spending time cleaning up code even if it was already working

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!