Tuesday, 4 November 2014

INTERFACE

Interface
Default properties
1.All data members are public default.All methods are abstract. All variables are static and final
2.Cannot create an object to the Interface--> Interface it = new Interface();(Which is wrong)
3.If we impelemnts any interface to an class and if we donot implements the methods of the Interface
   then the class should be abstract
4.Advantage is Runtime Polymorphism
5.N number of interfaces can implements by an class

Uses of Interface:
There are mainly three reasons to use interface. They are given below.
                  1.It is used to achieve fully abstraction.
                  2.By interface, we can support the functionality of multiple inheritance.
                  3.It can be used to achieve loose coupling.


interface
Print Friendly Version of this pagePrint Get a PDF version of this webpagePDF

No comments:

Simplest way to display Server Time in JSP using js

THE BELOW CODE WORKS ONLY IN JSP : <html> <body > <table width="95%" border="1" cellpadding="1...