Java Interface Real time example

Let's see another example of java interface which provides the implementation of Bank interface.

File: TestInterface2.java


\begin{lstlisting}
interface Bank{
float rateOfInterest();
}
class SBI imple...
...I();
System.out.println(''ROI: ''+b.rateOfInterest());
}
}
\end{lstlisting}

Output:


\begin{lstlisting}
ROI: 9.15
\end{lstlisting}