Q:

How to call a method of a parameterized type?

Just jumping into Java Generics and I've run into a bit of a problem: I can't seem to invoke the method of a parameterized type:
class test 
{
    public static void main( String args[ ] )
    {    
        invoke_baz( new foo( ) );
    }
    public static < Type > void invoke_baz( Type object )
    {
        object.baz( );
    }   
    public static class foo
    {
        public void baz( )
        {   }
    }       
}

What am I missing here?

A:

You've declared your generic type parameter Type, but it could be anything, not just a foo, such as a String.
Restrict type with an upper bound so that you know it's some kind of foo:
public static <Type extends foo> void invoke_baz( Type object )

Alternatively, just ask for a foo in your argument, removing any need for generics:
public static void invoke_baz(Foo object)

