Suppose we want that bank balance should be accessed only by Father & his Son, not by Grandson, then we should use bounded wildcard argument to restrict Grandson from getting to access to bank balance.

The method privacy(BoundedWC<? super Son>) in the type BoundedWC<T> is not applicable for the arguments (BoundedWC<GrandSon>)

Because we have bounded the wild card used in the privacy() method.

This is known as a lower bounding of a wildcard.In Lower bound, only declared subclass type and its superclasses are allowed to operate on a method.

Lower bound is achieved by syntax as given below:

<? supersubclass>

Subclassis the name of the class that decides the lower limit.

Since we have used Lower Bound syntax in the privacy() method of above program, privacy() method can be accessed only by Son& its superclass Father.

Similarly, Generics allows us to use Upper Bound.

In Upper Bound, only declared superclass type and its subclasses are allowed to operate on a method.

Upper bound is achieved by syntax as given below:

<? extendssuperclass>

Superclassis the name of the class that decides the upper limit.

Suppose we want that bank balance should be accessed only by Son& GrandSon, not by Father, then we should use Upper Bound wildcard argument in the privacy() method to restrict Fatherfrom getting to access to bank balance.