Friday 5 July 2013

introduction to Java Interface

// siddhu vydyabhushana // 1 comment
Interfaces are similar to abstract classes, but differ in their functionality. In interfaces, none of the methods are implemented means interfaces defines methods without body.

 Interfaces are syntactically similar to classes, but they lack instance variables, and their methods are declared without any body. But, it can contain final variables, which must be initialized with values. 

Once it is defined, any number of classes can implement an interface. One class can implement any number of interfaces. If we are implementing an interface in a class we must implement all the methods defined in the interface as well as a class can also implement its own methods.

 Interfaces add most of the functionality that is required for many applications which would normally resort to using multiple inheritance in C++.

1 comment:

  1. I have read your blog its very attractive and impressive. I like it your blog.

    Best BCA Colleges in Noida

    ReplyDelete