Generic Interface

Generic interface can be specified in same way as generic class. Let's take one example of generic interface.

Example :


 interface one 
{
void printValue(T );
}
class my implements one
{
void printValue(T a)
{
System.out.println("value:"+a.toString());
}
}
class example
{
public static void main(String arg[])
{
my ob=new my();
ob.printValue("this is demo");
}
}