CCB Premier Import
This commit is contained in:
15
11-SOURCES/generique/Couple.java
Normal file
15
11-SOURCES/generique/Couple.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package generique;
|
||||
|
||||
class Couple<T> {
|
||||
private T x, y ; // les 2 elements du couple seront du m<>me type
|
||||
|
||||
public Couple (T premier, T second){
|
||||
x = premier ; y = second ;
|
||||
}
|
||||
public T getPremier () {
|
||||
return x ;
|
||||
}
|
||||
public void affiche () {
|
||||
System.out.println ("Couple : 1ere val : " + x + " - 2e val : " + y ) ;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user