Question: Choose the appropriate method for each class. ClassA: public class ClassA implements Comparable { private String var; public ClassA ( String var ) { this.var
Choose the appropriate method for each class.
ClassA:
public class ClassA implements Comparable
private String var;
public ClassAString var
this.var var;
public String getVar
return var;
public int XXXClassA o
return var.XXXovar;
ClassB:
public class ClassB implements Comparator
@Override
public int YYYClassA o ClassA o
return ogetVarlength ogetVarlength;
What should XXX and YYY be
Group of answer choices
XXX is compare and YYY is compareTo
Both are compareTo
Both are compare
XXX is compareTo and YYY is compare
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
