4,
POLITECHNIKA RZESZOWSKA - Wydział Elektrotechniki łInformatyki
interface ItyInterface<T> {
void myMethod(T arg); ■ ■
public class Gener±cInterface<T> implements MyInterface<T> {
public static void main(String[] args) { GenericInterface<Strxng> objl = new
GenericInterface<Strlng>();
obj1.myMethod("Java");
GenericInterface<Double> obj2 = new
GenericInterface<Double>();
obj2.myMethod(123.0);
}
public void myMethod(T t) {
System.out.println("Hello from myMethod ! ” + t);