Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 workingStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started