Friday, October 7, 2011

Can You define a constructor in the Interface



In java will you be able to define a constructor in an interface.

First of all we cannot define a constructor inside a Interface. Any Interface will not allow any one to define a interface. Interface is to declare only that means it declares only Contracts. the class which Implements that interface can have a constructor.


My bottom line if that, After all Constructor is a method, interface cannot define a  method it can declare a method which return some value.

No comments:

Post a Comment