Saturday 25 June 2016

Difference between class,interface and enum

Interface is fully unimplemented class,it is used for defining set object operations,where as class is a fully implemented class.

Class is used for implementing an object operations.

So,interface does not allow methods logic where as class allows methods with logic.


for example: Bank is the object created as interface in java and HDFC bank, ICICI bank are created as classes with bank operations withdraw,deposit implementations.

No comments: