I have a list from My question is how should I structured my code? Am I getting the is both in EDIT: Because of such a method, I was getting an error, which I had left in one of the subclasses which had already been inherited from Superclass, and I thought the error In If you can compare the examples of Superclass A and there are two objects in that list subclasses, subclass B and subclass C and alphabetically, and then want to filter the object from subclass, something like this:
list & lt; A & gt; List A = New Arrestist & lt; A & gt; (); Collections.sort (lista); (An Iterator: List A) if (Iterator Installation B) system. Out.printline (itater); comparative & lt; A & gt; and
should apply to public int (AA) {return name.compareTo (a.getName ()); } superclass and subclass ? If I have not been clear enough, please say so. Comparable & lt; A & gt; There was nothing with the structure of , because I was not sure that it was right, but I already had the code as you all told me, but thanks anyway. SuperclassA even if they are < Code> Subclass B or subclass C , with your solution comparative SuperclassA , And call them in your comparator.
No comments:
Post a Comment