Alex Rivera | Logout

What does <T extends mean?

Asked 2012-10-17T06:28:48.197
58

I have seen a method like shown below:

protected <T extends ABC> T save( T Acd, boolean en) {

What does it do? What is these type of method declarations called in Java?

Edit
Report

1 Answer

50

It is called a generic method. This whole concept is called "Generics" in Java. That declaration means T can be any type that is subclass of ABC.

answered 2012-10-17T06:31:20.520

Your Answer