DEV 3.2 ; TP01
This commit is contained in:
10
DEV 3.2/TP01/Tableaux/Sorter.java
Normal file
10
DEV 3.2/TP01/Tableaux/Sorter.java
Normal file
@@ -0,0 +1,10 @@
|
||||
import java.util.Comparator;
|
||||
|
||||
public class Sorter implements Comparator<String> {
|
||||
|
||||
@Override
|
||||
public int compare(String o1, String o2) {
|
||||
return o1.compareTo(o2);
|
||||
}
|
||||
|
||||
}
|
||||
10
DEV 3.2/TP01/Tableaux/Tableaux.java
Normal file
10
DEV 3.2/TP01/Tableaux/Tableaux.java
Normal file
@@ -0,0 +1,10 @@
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Tableaux {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String[] args2 = Arrays.copyOf(args, 5);
|
||||
Arrays.sort(args2, new Sorter());
|
||||
System.out.println(Arrays.toString(args2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user