In previous tutorial we used single class or interface as bounded type. But we can apply multiple bounded types at a time. See the below example.

public class Sample<T extends Runnable & Comparable > 
{
    --
    --
    --
}



From the above example , we passed multiple bounded types. Sample class allows Runnable and Comparable implemented classes . In this way we can pass any number of interfaces but we can pass only single class with multiple interfaces. And Another rule is we have to extend class first then any number of interfaces.

public class Sample<T extends Runnable & Comparable & Serialgable > 
public class Sample<T extends String & Runnable & Comparable > 
public class Sample<T extends String & Integer & Comparable > 
// causes compiler error . Only one class is allowed .
public class Sample<T extends Runnable & Integer & Comparable > 
// causes compiler error . Class should be first one .