Interface in java with real time example

Veröffentlicht am: 31 Juli 2017
auf dem Kanal: JAVA KI PATHSALA
1,823
9

interface a type of class, it is fully unimplemented class for creating a new object obtaining the set of operation of this object...
interface also contain
1.. public static final variables
2.. public abstract method..

Basically we use interface because to develop multiple implementation inheritance

--interface is a pure abstract class because it contain only abstract methods....
--- after java 8 on words interface contains implementation with body..
1..default method
2..static method

Q) why use interface instated of abstract class????
if we define abstract class in place of interface. a object implementation programmer cant implement different objects specification with single sub class.. so


advantage:
========

1)multiple inheritance
2)it is loosely coupled and run time polymorphic application..


ans:::

what operation is available in the object
what operation should be implement....



interface shape{
double pi=3.14;
void Area();
}


rules:
=========

cant have concrete method...
static final variables and
cant declared interface private or protected...
u have to initialis the variable other wise it give compile time error..

cant declared interface as final it give to me compile time error..


Auf dieser Seite können Sie das Online-Video Interface in java with real time example mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer JAVA KI PATHSALA 31 Juli 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,823 Mal angesehen und es wurde von 9 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!