public class Main {
public static void main(String[] args) {
Pair pair = new Pair();
Sayable tester = new Tester();
tester.theSameAs(pair);
}
}
class Pair {
public String StringSay;
public void saySomething() {
System.out.println("ÐеÑод saySomething ÑÑабоÑал без generics");
}
}
class Tester implements Sayable {
public void theSameAs(Pair object) {
System.out.println("РклаÑÑе ТеÑÑÐµÑ Ñ Ð³Ð¾Ð²Ð¾ÑÑ theSameAs ÑÑабоÑал Ñ generics: " + object);
}
}
interface Sayable {
public void theSameAs(T object);
}
//