Thursday, 26 April 2018

Advantage and Disadvantage of Interface

Interface:
 only know the customer requirement and don't know the implementation than go for interface.


Advantage:


  • 100% abstract
  • Multiple inheritance
  • All variables are public static and final.
  • all methods are abstract 
Disadvantage:

  • can't have contractor
  • can't serialized the object because you can't create the object of Interface.
  • can't declare method as static , final, synchronized
  • can't declare variable with private,protected,transient,volatile
  • can't declare instance block or static block for interface.

No comments:

Post a Comment

session-per-request in hibernate

The most common pattern in a multi-user client/server application is session-per-request . In this model, a request from the client is sent...