User Tools

Site Tools


java:anon_inner_classes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
java:anon_inner_classes [2021/04/12 06:23] – [Παράδειγμα - Ανώνυμη εμφωλευμένη κλάση ως επέκταση υφιστάμενης κλάσης] gthanosjava:anon_inner_classes [2023/03/23 20:43] (current) – [Παράδειγμα - Ανώνυμη εμφωλευμένη κλάση ως υλοποίηση ενός interface] gthanos
Line 54: Line 54:
     Collections.sort(students, new Comparator<Student>() {     Collections.sort(students, new Comparator<Student>() {
         public int compare(Student st1, Student st2) {         public int compare(Student st1, Student st2) {
-          int cmp = cmp = st1.AEM - st2.AEM;+          int cmp = st1.AEM - st2.AEM;
           if(cmp==0)           if(cmp==0)
             cmp = st1.lastName.compareTo(st2.lastName);                         cmp = st1.lastName.compareTo(st2.lastName);            
Line 85: Line 85:
 </code> </code>
  
-<code java>+<code java SortListOfStudents.java>
 import java.io.*; import java.io.*;
 import java.util.*; import java.util.*;
java/anon_inner_classes.1618208587.txt.gz · Last modified: 2021/04/12 05:23 (external edit)